22 lines
554 B
Bash
22 lines
554 B
Bash
|
#!/bin/bash
|
|||
|
set -e
|
|||
|
source $HOME/scripts/config.env
|
|||
|
|
|||
|
read -p "DANGER – everything will be made permanent. Proceed? (Yy)" -n 1 -r
|
|||
|
echo
|
|||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]
|
|||
|
then
|
|||
|
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
|
|||
|
fi
|
|||
|
|
|||
|
cd $HOME/flarum
|
|||
|
|
|||
|
php ./flarum nearataMaintenanceMode:toggle true
|
|||
|
|
|||
|
echo "creating database dump..."
|
|||
|
mysqldump -u$dbuser $db --add-drop-table > $dump
|
|||
|
|
|||
|
echo "syncing flarum..."
|
|||
|
rsync -aAX --delete /home/pacs/$pac/users/$user/flarum/ /home/pacs/$pac/users/$user/var/rollback/flarum/
|
|||
|
|
|||
|
php ./flarum nearataMaintenanceMode:toggle false
|