summaryrefslogtreecommitdiffstats
path: root/scripts/sh/remove_ergo.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/sh/remove_ergo.sh')
-rwxr-xr-xscripts/sh/remove_ergo.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/sh/remove_ergo.sh b/scripts/sh/remove_ergo.sh
new file mode 100755
index 0000000..c9af4de
--- /dev/null
+++ b/scripts/sh/remove_ergo.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+if [ ! /opt/ergo ]
+echo
+then
+read -p "Remove Ergo? This will kill running Ergo services and cause data loss. " -n 1 -r
+echo
+if [[ $REPLY =~ ^[Yy]$ ]]
+then
+echo "Removing Ergo"
+systemctl disable --now ergo.service || true
+rm -f /etc/systemd/system/ergo.service
+rm -rf /opt/ergo
+userdel -f ergo
+groupdel -f ergo
+echo "OK"
+fi
+else
+echo "Could not find a compatible installation of Ergo."
+fi