From 74f20a3150b0fac353edb0a22864e34945d6b8e7 Mon Sep 17 00:00:00 2001 From: Prateek Machiraju Date: Thu, 6 Aug 2020 15:52:54 -0400 Subject: [PATCH] Remove photonvision service if it already exists (#76) --- scripts/install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index eb249c93a..5f54506c3 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -27,6 +27,16 @@ curl -s https://api.github.com/repos/photonvision/photonvision/releases/latest | echo "Downloaded latest stable release of PhotonVision." echo "Creating the PhotonVision systemd service..." + +if service --status-all | grep -Fq 'photonvision'; then + systemctl stop photonvision + systemctl disable photonvision + rm /lib/systemd/system/photonvision.service + rm /etc/systemd/system/photonvision.service + systemctl dameon-relaod + systemctl reset-failed +fi + cd /lib/systemd/system/ touch photonvision.service printf \