From 6206828af26078d197d14ee6a4ae76f6846f2a43 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Sat, 16 Apr 2022 09:49:11 -0400 Subject: [PATCH] better uninstaller --- scripts/uninstall.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index da7d4c4..1d2a427 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -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