mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
15 lines
323 B
Plaintext
15 lines
323 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
command -v deb-systemd-invoke > /dev/null
|
||
|
has_systemd=$?
|
||
|
|
||
|
if [ $has_systemd -eq 0 ]; then
|
||
|
systemctl daemon-reload
|
||
|
fi
|
||
|
|
||
|
if [ $has_systemd -eq 0 ] && [ -n "$(systemctl list-units --plain --no-legend {{.Service}})" ]; then
|
||
|
deb-systemd-invoke try-restart "{{.Service}}"
|
||
|
else
|
||
|
pkill -HUP -x {{.Command}}
|
||
|
fi
|