diff --git a/go-daemon/install.sh b/go-daemon/install.sh index 58d9429..b038148 100644 --- a/go-daemon/install.sh +++ b/go-daemon/install.sh @@ -15,7 +15,10 @@ go build -o ./bin/ # Installing sudo mv ./bin/godaemon1 /usr/bin/godaemon1 -sudo mv ./godaemon1.service /etc/systemd/system/ +if [ $(ps -jp 1 | awk 'FNR == 2 {print $6}') == "systemd" ] +then + sudo mv ./godaemon1.service /etc/systemd/system/ +fi sudo systemctl daemon-reload sudo systemctl enable godaemon1 sudo systemctl start godaemon1