diff options
author | Georg Pfuetzenreuter | 2021-07-23 17:34:09 +0200 |
---|---|---|
committer | Georg Pfuetzenreuter | 2021-07-23 17:34:09 +0200 |
commit | c85c094f27483abb76a3cd4e1ed8fa8e88f3bd43 (patch) | |
tree | b1601c0bc97f9312a3add3f078a2668de005a62b /scripts/sh/deploy_ergo.sh | |
parent | 1f2002a2952d5c3c72e2a8afb1bb76b3c90dd022 (diff) | |
download | system-c85c094f27483abb76a3cd4e1ed8fa8e88f3bd43.tar.gz system-c85c094f27483abb76a3cd4e1ed8fa8e88f3bd43.tar.bz2 system-c85c094f27483abb76a3cd4e1ed8fa8e88f3bd43.zip |
Go and Ergo Deployment Scripts
Signed-off-by: Georg Pfuetzenreuter <georg@lysergic.dev>
Diffstat (limited to 'scripts/sh/deploy_ergo.sh')
-rwxr-xr-x | scripts/sh/deploy_ergo.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/sh/deploy_ergo.sh b/scripts/sh/deploy_ergo.sh new file mode 100755 index 0000000..83b6b03 --- /dev/null +++ b/scripts/sh/deploy_ergo.sh @@ -0,0 +1,27 @@ +#!/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 +read -p "Deploy Ergo on this system? " -n 1 -r +echo +if [[ $REPLY =~ ^[Yy]$ ]] +then +zypper in --no-recommends -y git make +REPO="https://github.com/ergochat/ergo.git" +mkdir /opt/ergo +useradd -rUd /opt/ergo -s /bin/false ergo +chown ergo:ergo /opt/ergo +chmod 750 /opt/ergo +usermod -aG ergo pratyush +usermod -aG ergo georg +sudo -u ergo git clone $REPO /opt/ergo/ergo-git +cd /opt/ergo/ergo-git +sudo -u ergo make build +sudo -u ergo chmod +x ergo +ln -s /opt/ergo/ergo-git/ergo /opt/ergo/ergo +fi +else +echo "This is currently only compatible with Go 1.16.6 or higher. Consider deploy_go.sh." +fi |