feat: check if systemd is init

This commit is contained in:
Aliberk Sandıkçı 2023-07-29 13:21:35 +03:00
parent a0f16fff1b
commit 30d61c2969
Signed by: asandikci
GPG key ID: 25C67A03B5666BC1

View file

@ -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