LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 04: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 03:18 AM.
 
Old 04-25-2012, 10:13 PM   #2
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
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, 03: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



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 09:41 PM
vpn connect/disconnect shell script rashmeepawar Programming 11 10-05-2009 08:15 AM
wpa_supplicant cannot connect after disconnect embed Linux - Networking 1 03-03-2009 03:39 PM
Connect online ubuntu 8.0 disconnect after 2 min error 15 no response to echo billrandle Linux - Networking 2 06-04-2008 07:01 PM
squid configuration for constent VPN connect/disconnect MikeyCarter Linux - Software 0 12-12-2006 02:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:11 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration