LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-25-2012, 05:31 AM   #1
Snigger
Member
 
Registered: Jul 2007
Distribution: Ubuntu Lucid Lynx
Posts: 55

Rep: Reputation: 15
Question 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.

Last edited by Snigger; 04-26-2012 at 04:18 AM.
 
Old 04-25-2012, 11:13 PM   #2
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Rep: Reputation: 116Reputation: 116
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?
 
Old 04-26-2012, 04:24 AM   #3
Snigger
Member
 
Registered: Jul 2007
Distribution: Ubuntu Lucid Lynx
Posts: 55

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Skaperen View Post
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 & ...)
 
  


Reply

Tags
shell script, vpn


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I connect a single windows machine to an Ubuntu 10.04 box via vpn or similar? 2legit2quit Linux - Newbie 2 01-29-2012 10:41 PM
vpn connect/disconnect shell script rashmeepawar Programming 11 10-05-2009 09:15 AM
wpa_supplicant cannot connect after disconnect embed Linux - Networking 1 03-03-2009 04:39 PM
Connect online ubuntu 8.0 disconnect after 2 min error 15 no response to echo billrandle Linux - Networking 2 06-04-2008 08:01 PM
squid configuration for constent VPN connect/disconnect MikeyCarter Linux - Software 0 12-12-2006 03:00 PM


All times are GMT -5. The time now is 04:35 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration