feat: check if systemd is init
This commit is contained in:
parent
a0f16fff1b
commit
30d61c2969
1 changed files with 4 additions and 1 deletions
|
@ -15,7 +15,10 @@ go build -o ./bin/
|
||||||
|
|
||||||
# Installing
|
# Installing
|
||||||
sudo mv ./bin/godaemon1 /usr/bin/godaemon1
|
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 daemon-reload
|
||||||
sudo systemctl enable godaemon1
|
sudo systemctl enable godaemon1
|
||||||
sudo systemctl start godaemon1
|
sudo systemctl start godaemon1
|
||||||
|
|
Loading…
Reference in a new issue