Created
January 9, 2012 12:27
-
-
Save xream/1582732 to your computer and use it in GitHub Desktop.
Mac VPN auto reconnect script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set the VPN service name | |
VPN="" | |
function xxre () { | |
echo "VPN is not connected!" | |
echo "Reconnecting!" | |
networksetup -connectpppoeservice $VPN | |
sleep 5 | |
} | |
ifconfig|grep ppp0||xxre | |
while [[ 1 ]]; do | |
ifconfig|grep ppp0||xxre | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
改了下能用,开心