Skip to content

Commit

Permalink
fix uninstall-sh script not removing service
Browse files Browse the repository at this point in the history
  • Loading branch information
henne49 committed Jun 6, 2024
1 parent 84e386a commit f75bef8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f75bef8

Please sign in to comment.