hs.scripts/rollback/keycloak/rollback.sh

24 lines
494 B
Bash
Raw Normal View History

2024-10-24 12:50:47 +02:00
#/bin/bash
set -e
source $HOME/scripts/env
echo "stopping $app..."
systemctl stop --user $app
echo "restoring database..."
# -c drops all objects that are to be restored
pg_restore -c -h localhost -U $user -d $db < $dump
systemctl start --user $app
echo "started $app..."
sleep 2
systemctl --no-pager status --user $app
echo "setting new demouser password"
echo "waiting a crazy amount of 20s so keycloak has time to open that port..."
sleep 20
. $HOME/scripts/set-demopw.sh
echo "done."