forked from ComputerByte/sonarr4k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arr2uninstall.sh
37 lines (28 loc) · 890 Bytes
/
arr2uninstall.sh
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
33
34
35
36
37
#!/bin/bash
# Script by @ComputerByte modified by @Betonhaus
# For Uninstalling the additional Sonarr instances
#prompt for name of instance to remove
echo "Please enter the following information of the server, ensure there are no typos"
echo "System (url) name for server (sonarr2):"
read arrsysname
if [ -z "$arrsysname" ]
then arrsysname="sonarr2"
fi
echo "removing $arrsysname. Are you sure? y/(n):"
read input
if [ "$input" != "y" ]
then echo "exiting."
exit 1
fi
# Log to Swizzin.log
export log=/root/logs/swizzin.log
touch $log
systemctl disable --now -q $arrsysname
rm /etc/systemd/system/$arrsysname.service
systemctl daemon-reload -q
if [[ -f /install/.nginx.lock ]]; then
rm /etc/nginx/apps/$arrsysname.conf
systemctl reload nginx
fi
rm /install/.$arrsysname.lock
sed -i.bak -e '/class ${arrsysname}_meta:/,+9d' /opt/swizzin/core/custom/profiles.py