hs.scripts/rollback/flarum/setstate.sh
2024-05-02 11:33:35 +02:00

22 lines
554 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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