Change ps check string (add a second one).
This commit is contained in:
parent
762e6116d9
commit
24ba503a6f
10
check_vpn.sh
10
check_vpn.sh
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
check_string_ps=""
|
check_string_ps=""
|
||||||
if [[ -f "/usr/sbin/openvpn" ]] ; then
|
if [[ -f "/usr/sbin/openvpn" ]] ; then
|
||||||
check_string_ps="/usr/sbin/openvpn --daemon"
|
check_string_ps="/usr/sbin/openvpn"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
check_string_ps_plus="--daemon"
|
||||||
|
|
||||||
|
|
||||||
# - used, if systemd is NOT supported
|
# - used, if systemd is NOT supported
|
||||||
init_script=""
|
init_script=""
|
||||||
@ -123,7 +125,7 @@ if $LOGGING ; then
|
|||||||
echo -e " ====================================="
|
echo -e " ====================================="
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PID=$(ps -e f | grep -E "[[:digit:]]\ ${check_string_ps}"| grep -v grep | awk '{print$2}')
|
PID=$(ps -e f | grep -E "[[:digit:]]\ ${check_string_ps}" | grep "\ ${check_string_ps_plus}\ " | grep -v grep | awk '{print$2}')
|
||||||
if [[ "X${PID}" = "X" ]]; then
|
if [[ "X${PID}" = "X" ]]; then
|
||||||
|
|
||||||
error "OpenVPN Service seems to be down! Trying to restart service now.."
|
error "OpenVPN Service seems to be down! Trying to restart service now.."
|
||||||
@ -151,10 +153,10 @@ if [[ "X${PID}" = "X" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
declare -i counter=0
|
declare -i counter=0
|
||||||
PID=$(ps -e f | grep -E "[[:digit:]]\ ${check_string_ps}"| grep -v grep | awk '{print$2}')
|
PID=$(ps -e f | grep -E "[[:digit:]]\ ${check_string_ps}" | grep "\ ${check_string_ps_plus}\ " | grep -v grep | awk '{print$2}')
|
||||||
while [[ "X${PID}" = "X" ]]; do
|
while [[ "X${PID}" = "X" ]]; do
|
||||||
sleep 1
|
sleep 1
|
||||||
PID=$(ps -e f | grep -E "[[:digit:]]\ ${check_string_ps}"| grep -v grep | awk '{print$2}')
|
PID=$(ps -e f | grep -E "[[:digit:]]\ ${check_string_ps}" | grep "\ ${check_string_ps_plus}\ " | grep -v grep | awk '{print$2}')
|
||||||
if [[ $counter -gt 10 ]]; then
|
if [[ $counter -gt 10 ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user