vpnc

How to detect vpnc disconnection ?

Hi, What is the easiest way to detect that a vpnc connection on Linux/Ubuntu has disconnected ? Manually, I think the way to detect is to check whether the interface (tun0) appears in /sbin/ifconfig output. Is there a better way to find out immediately, so that a script can be run to restart the connection ? ...

Trying to start VPNC from PHP exec()

I am trying to start my VPN connection (using VPNC) from PHP. I have to do it this way because it is closed remotely if there isn't activity so I can't just leave it running on the server. I am able to do it from the command line by typing: /usr/local/sbin/vpnc --natt-mode force-natt This works. It doesn't require any input from me...