hs.scripts/rollback/flarum/setstate.sh

22 lines
554 B
Bash
Raw Permalink Normal View History

2024-05-02 11:33:35 +02:00
#!/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