Skip to content

Commit

Permalink
remove existing homebridge.service if it exists pre-install
Browse files Browse the repository at this point in the history
  • Loading branch information
oznu committed Apr 25, 2022
1 parent d330774 commit 7d3cb40
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions deb/debian/preinst
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
#!/bin/bash

# before install
if [ "$1" = "install" ]; then
echo "Running pre-install steps..."

# check for existing homebridge.service
if [ -f /etc/systemd/system/homebridge.service ]; then
# stop homebridge.service if it is running
if systemctl is-active --quiet homebridge.service; then
echo "Stopping existing Homebridge service..."
systemctl stop homebridge
fi

# disable and remove the old homebridge.service
echo "Removing existing Homebridge service..."
systemctl disable homebridge.service
rm -rf /etc/systemd/system/homebridge.service
systemctl daemon-reload
fi
fi

# before an upgrade
if [ "$1" = "upgrade" ] && [ $2 ]; then
echo "Running pre-upgrade steps..."
Expand Down

0 comments on commit 7d3cb40

Please sign in to comment.