Compare commits

...

4 commits

Author SHA1 Message Date
Thomas Sjögren
23110269a6
Merge pull request #549 from konstruktoid/issue548
include /run in get_service_file
2024-04-16 18:12:13 +02:00
Thomas Sjögren
966929427e correct tests and instructions
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2024-04-16 07:32:23 +00:00
Thomas Sjögren
287fd8774b
systemctl always returns an FragmentPath
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2024-04-12 08:17:17 +00:00
Thomas Sjögren
e081393ad7
include /run in get_service_file
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2024-04-11 21:45:15 +00:00

View file

@ -140,7 +140,11 @@ get_service_file() {
echo "/lib/systemd/system/$SERVICE"
return
fi
if systemctl show -p FragmentPath "$SERVICE" 2> /dev/null 1>&2; then
if find /run -name "$SERVICE" 2> /dev/null 1>&2; then
find /run -name "$SERVICE" | head -n1
return
fi
if [ "$(systemctl show -p FragmentPath "$SERVICE" | sed 's/.*=//')" != "" ]; then
systemctl show -p FragmentPath "$SERVICE" | sed 's/.*=//'
return
fi