better uninstaller

This commit is contained in:
mcguirepr89
2022-04-16 09:49:11 -04:00
parent 377ccd9da0
commit 6206828af2
+4 -1
View File
@@ -6,13 +6,16 @@ my_dir=$HOME/BirdNET-Pi/scripts
source /etc/birdnet/birdnet.conf &> /dev/null
SCRIPTS=($(ls -1 ${my_dir}) ${HOME}/.gotty)
set -x
services=($(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort))
services=($(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort) custom_recording.service avahi-alias@.service)
remove_services() {
for i in "${services[@]}"; do
if [ -L /etc/systemd/system/multi-user.target.wants/"${i}" ];then
sudo systemctl disable --now "${i}"
fi
if [ -L /lib/systemd/system/"${i}" ];then
sudo rm -f /lib/systemd/system/$i
fi
if [ -f /etc/systemd/system/"${i}" ];then
sudo rm /etc/systemd/system/"${i}"
fi