LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   detecting VPN connect/disconnect on Ubuntu (http://www.linuxquestions.org/questions/programming-9/detecting-vpn-connect-disconnect-on-ubuntu-941630/)

Snigger 04-25-2012 04:31 AM

detecting VPN connect/disconnect on Ubuntu
 
Hi
I'm using Ubuntu's Network Manager to connect to a PPTP VPN.
I have a data mining application that should only run when VPN is connected.
I need to run it when VPN connected & Kill it when VPN disconnected.
How Can I detect VPN connect/disconnect using shell script.

Skaperen 04-25-2012 10:13 PM

Would it be sufficient to detect the VPN being up or down by pinging the server to be connected to, and using the output (grep for 'bytes from') to determine if the server is reachable or not?

Snigger 04-26-2012 03:24 AM

Quote:

Originally Posted by Skaperen (Post 4663147)
Would it be sufficient to detect the VPN being up or down by pinging the server to be connected to, and using the output (grep for 'bytes from') to determine if the server is reachable or not?

I need to check my own box's VPN connection to see it is connected or not & the server is not important for me (the network manager should handle it)
It's possible that VPN server be reachable (and connectable) but the VPN connection be disconnected! (User disconnect it, connection dropped & ...)


All times are GMT -5. The time now is 09:47 PM.