Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question: cron to pkill non-responsive VPN connection

4 views
Skip to first unread message

lihao

unread,
Jun 1, 2012, 11:06:01 AM6/1/12
to
I have one bash script under RHEL 5.3 to reconnect the VPN whenever
it's broken i.e.
############
if ! ps -C 'vpnclient' --no-heading >/dev/null 2>&1
then
echo "relink at $(date +%F\ %T)"
nohup /path/to/vpnclient connect ******* >/dev/null &
fi
#############

sometimes the ps command displays vpnclient OK but the connection is
stale, there is no actual connection until I run pkill vpnclient and
reconnect the VNP.

is there any way that I can detect if a connection is stale for a
certain time i.e. 120 seconds, and then run the pkill command in order
to re-establish the connection?

many thanks,
lihao
Message has been deleted
0 new messages