Last active
September 23, 2019 19:10
-
-
Save gurdiga/451f69d12f4c8f9673c9a9071a510ad4 to your computer and use it in GitHub Desktop.
A script to automate the update phpBB3 from a given download URL. Accepts the download URL as its single argument.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://sipb.mit.edu/doc/safe-shell/ | |
set -xeuf -o pipefail | |
archive_url="$1" | |
archive_name=`basename $archive_url` | |
wget --no-verbose $archive_url | |
mv $archive_name tmp | |
rm -rf ~/tmp/phpBB3 | |
unzip -q ~/tmp/$archive_name -d tmp | |
rm -rf ~/tmp/phpBB3/{config.php,images,store,files} | |
backup_name=`date +%F` | |
mysqldump phpbb > ~/backup/phpbb-$backup_name.sql | |
rm -rf ~/backup/phpbb-$backup_name-files | |
cp -rp /var/www/html ~/backup/phpbb-$backup_name-files | |
rm -rf /var/www/html/{vendor,cache} | |
rsync -r ~/tmp/phpBB3/ /var/www/html | |
chown -R www-data:www-data /var/www/html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment