check_sympa_service.sh: respect that the Path of the started binary could be a symlink.

This commit is contained in:
Christoph 2018-11-21 14:21:38 +01:00
parent 0154e78671
commit f08ed0d009

View File

@ -189,12 +189,22 @@ if $terminal ; then
echo -e " ===================================" echo -e " ==================================="
fi fi
for _command in $sympa_commands ; do # - Note:
# -
# - first we will check '/usr/local/symba/bin/<command'
# - second we will check '$(realpath "/usr/local/symba/bin/<command>"'
# - i.e /usr/local/sympa-6.2.36/bin/<command>
# -
for _command in $wwsympa_commands ; do
PIDS="$(ps ax | grep -E "${_command}" | grep -v grep | awk '{print$1}')"
if [[ -z "$PIDS" ]]; then
_command="$(realpath "${_command}")"
PIDS="$(ps ax | grep -E "${_command}" | grep -v grep | awk '{print$1}')" PIDS="$(ps ax | grep -E "${_command}" | grep -v grep | awk '{print$1}')"
if [[ -z "$PIDS" ]]; then if [[ -z "$PIDS" ]]; then
restart_needed=true restart_needed=true
break break
fi fi
fi
done done
if $restart_needed ;then if $restart_needed ;then