2021-04-11 20:04:15 +02:00
|
|
|
#!/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
|
2021-05-04 18:33:25 +02:00
|
|
|
pkill -HUP -x {{.Command}} || :
|
2021-04-11 20:04:15 +02:00
|
|
|
fi
|