diff options
author | Georg Pfuetzenreuter | 2021-07-23 18:26:54 +0200 |
---|---|---|
committer | Georg Pfuetzenreuter | 2021-07-23 18:32:41 +0200 |
commit | 98b3b710a97a9047c4fbce5144e93d15ee435956 (patch) | |
tree | 3ec49dca64b4da55e1efb8462b18f8b4f044fc22 | |
parent | 9ad1234cc4c05e5ee5d3dede508652bb30fe0966 (diff) | |
download | system-98b3b710a97a9047c4fbce5144e93d15ee435956.tar.gz system-98b3b710a97a9047c4fbce5144e93d15ee435956.tar.bz2 system-98b3b710a97a9047c4fbce5144e93d15ee435956.zip |
Ergo deployment OS and existing installation check.
Signed-off-by: Georg Pfuetzenreuter <georg@lysergic.dev>
-rwxr-xr-x | scripts/sh/deploy_ergo.sh | 13 | ||||
-rwxr-xr-x | scripts/sh/remove_ergo.sh | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/scripts/sh/deploy_ergo.sh b/scripts/sh/deploy_ergo.sh index 29eb9e0..b7486a4 100755 --- a/scripts/sh/deploy_ergo.sh +++ b/scripts/sh/deploy_ergo.sh @@ -1,4 +1,11 @@ #!/bin/sh +DISTRIB=$(awk -F= '/^NAME/{print $2}' /etc/os-release) +echo "Detected $DISTRIB" +if [[ ${DISTRIB} = "openSUSE Leap" ]] +echo +then +if [ ! -d /opt/ergo ] +then GOVER=`go version | { read _ _ v _; echo ${v#go}; }` echo "Detected Go $GOVER" GOVER_REQ="1.16.0" @@ -53,3 +60,9 @@ fi else echo "This is currently only compatible with Go 1.16.6 or higher. Consider deploy_go.sh." fi +else +echo "Existing Ergo installation or leftovers detected. Consider remove_ergo.sh." +fi +else +echo "This is currently only compatible with SUSE Leap nodes." +fi diff --git a/scripts/sh/remove_ergo.sh b/scripts/sh/remove_ergo.sh index c9af4de..0634946 100755 --- a/scripts/sh/remove_ergo.sh +++ b/scripts/sh/remove_ergo.sh @@ -1,5 +1,5 @@ #!/bin/sh -if [ ! /opt/ergo ] +if [ ! -d /opt/ergo ] echo then read -p "Remove Ergo? This will kill running Ergo services and cause data loss. " -n 1 -r |