system/scripts/sh/remove_ergo.sh
Georg Pfuetzenreuter 684861fac1
Fixed condition.
Signed-off-by: Georg Pfuetzenreuter <georg@lysergic.dev>
2021-07-23 18:31:58 +02:00

20 lines
401 B
Bash
Executable File

#!/bin/sh
if [ ! -d /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