From 9ad1234cc4c05e5ee5d3dede508652bb30fe0966 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Fri, 23 Jul 2021 18:21:27 +0200 Subject: Ergo deployment improvements, new Ergo update and Ergo removal scripts Signed-off-by: Georg Pfuetzenreuter --- scripts/sh/update_ergo.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/sh/update_ergo.sh (limited to 'scripts/sh/update_ergo.sh') diff --git a/scripts/sh/update_ergo.sh b/scripts/sh/update_ergo.sh new file mode 100755 index 0000000..289bd4b --- /dev/null +++ b/scripts/sh/update_ergo.sh @@ -0,0 +1,26 @@ +#!/bin/sh +GOVER=`go version | { read _ _ v _; echo ${v#go}; }` +echo "Detected Go $GOVER" +GOVER_REQ="1.16.0" +if [ "$(printf '%s\n' "$GOVER_REQ" "$GOVER" | sort -V | head -n1)" = "$GOVER_REQ" ] +then +if [ -f /opt/ergo/ergo-git/ergo ] +then +read -p "Update Ergo on this system? This will immediately stop Ergo if it is running. " -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then +systemctl stop ergo.service +cd /opt/ergo/ergo-git +rm -f ergo +git pull +sudo -u ergo make build +sudo -u ergo /opt/ergo/ergo-git/ergo upgradedb --conf /opt/ergo/ircd.yaml +systemctl start ergo.service +fi +else +echo "Ergo does not seem to be installed. Consider deploy_ergo.sh." +fi +else +echo "This is currently only compatible with Go $GOVER_REQ or higher. Consider deploy_go.sh." +fi -- cgit v1.2.3