check_service.sh: Fix error in determin 'check_string_ps'.

This commit is contained in:
Christoph 2023-08-09 01:43:26 +02:00
parent d2c6bf3e48
commit b6bbf99bea

View File

@ -150,7 +150,7 @@ if [[ -n "$SYSTEMD_SERVICE" ]] ; then
_systemd_service_file="/lib/systemd/system/$SYSTEMD_SERVICE"
fi
if [[ -n "$_systemd_service_file" ]]; then
check_string_ps="$(trim $(cat "$_systemd_service_file" | grep ExecStart | grep -o -E "ExecStart\s*=\s*[^[:space:]]+" | cut -d "=" -f2))"
check_string_ps="$(trim $(cat "$_systemd_service_file" | grep ExecStart | grep -o -E "^\s*ExecStart\s*=\s*[^[:space:]]+" | cut -d "=" -f2))"
fi
else
check_string_ps="$(trim $(cat "$SYSV_INIT_SCRIPT" | grep DAEMON | grep -o -E "DAEMON\s*=\s*[^[:space:]]+" | cut -d "=" -f2))"