diff --git a/check_service.sh b/check_service.sh index 3825746..ed483d1 100755 --- a/check_service.sh +++ b/check_service.sh @@ -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))"