hs.scripts/rollback/synapse/update.sh
2024-04-25 13:49:12 +02:00

28 lines
736 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
read -p "DANGER Updating will also rollback this Synapse. Proceed? (Yy)" -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # https://stackoverflow.com/questions/1885525/how-do-i-prompt-a-user-for-confirmation-in-bash-script
fi
echo ">>> calling for rollback.sh"
. $HOME/scripts/rollback.sh
# rollback stops and starts on its own
monit stop synapse
echo ">>> proceeding with the update"
source ~/synapse/env/bin/activate
pip install --upgrade matrix-synapse[postgres] pip
echo ">>> calling setstate.sh to make the update permanent"
. $HOME/scripts/setstate.sh
monit start synapse
sleep 2
curl https://$(ls $HOME/doms)/_synapse/admin/v1/server_version|jq .