diff --git a/functions/helper_lib.sh b/functions/helper_lib.sh index 63bdd33..740fdcf 100644 --- a/functions/helper_lib.sh +++ b/functions/helper_lib.sh @@ -140,14 +140,14 @@ get_service_file() { echo "/lib/systemd/system/$SERVICE" return fi - if systemctl show -p FragmentPath "$SERVICE" 2> /dev/null 1>&2; then - systemctl show -p FragmentPath "$SERVICE" | sed 's/.*=//' - return - fi 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 echo "/usr/lib/systemd/system/$SERVICE" }