-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuninstall.sh
More file actions
32 lines (26 loc) · 863 Bytes
/
uninstall.sh
File metadata and controls
32 lines (26 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Uninstall Kellnr
# Check if the script is in the right work directory
if [ ! -d ./kellnr ]; then
echo "Cannot find Kellnr installation directory. Please run the script from the parent directory of the Kellnr installtion."
exit 1
fi
# Disable and remove systemd service
SERVICE="/etc/systemd/system/kellnr.service"
if [ -f $SERVICE ]; then
sudo systemctl stop kellnr
sudo systemctl disable kellnr
sudo rm $SERVICE
echo "Removed Kellnr service"
fi
# Remove data directory
DATADIR=$(sed -n -e "/^data_dir/p" ./kellnr/config/default.toml | cut -d= -f2 | tr -d ' ' | tr -d '"')
if [ -d $DATADIR ]; then
sudo rm -rf $DATADIR
echo "Removed Kellnr data directory: $DATADIR"
else
echo "Cannot find Kellnr data directory: $DATADIR"
exit 1
fi
# Remove Kellnr installation
sudo rm -rf kellnr*
echo "Removed Kellnr installation"