I am one of those who need to use vpnc
for a connection with a net. I've tried so many tutorials' example like this, this and this without success. I know decided to write a small script to reconnect after reconnection. my shell scripting is so bad that i don't know how to log what happens on the box. aside that , i just realized that pinging is disable on the machine i need to connect to. How can i go around it? here is my script which is added to crontab
to run every 5 minutes
#!/bin/bash
HOST=" 192.168.0.18"
pinging(){
ping -c6 $HOST
return $?
}
pinging
RESULT=$?
case $RESULT in
0)
#ping OK everything is fine
;;
1)
# no reply, meaning the host down then reconnect
/usr/sbin/vpnc configname
;;
2)
## Misc. ping errors,
# don't know what to do here. how do i log this?
;;
esac
so to recap, I need:
Be able to go around pinging. Other alternatives?
Be able to log what happens at every run or so
Can anyone help me achieve that?
vpnc
is no longer running?