From f75bef813de1f43fefd15f7408016ff3ba691d66 Mon Sep 17 00:00:00 2001 From: henne49 Date: Thu, 6 Jun 2024 15:42:28 +0200 Subject: [PATCH] fix uninstall-sh script not removing service --- uninstall.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/uninstall.sh b/uninstall.sh index 10493d9..f15c9f8 100644 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,15 +1,19 @@ #!/bin/bash SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) SERVICE_NAME=$(basename $SCRIPT_DIR) -filename=/data/rc.local +RC_LOCAL_FILE=/data/rc.local #remove the service rm /service/$SERVICE_NAME # end the dbus-opendtu process -kill $(pgrep -f 'supervise dbus-opendtu') +kill $(pgrep -f 'dbus-opendtu') # delete old logs if they exist if [ -f $SCRIPT_DIR/current.log ]; then rm $SCRIPT_DIR/current.log* fi + +# remove install.sh from rc.local +STARTUP=$SCRIPT_DIR/install.sh +sed -i "\~$STARTUP~d" $RC_LOCAL_FILE \ No newline at end of file