Skip to content

Instantly share code, notes, and snippets.

@xream
Created January 9, 2012 12:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save xream/1582732 to your computer and use it in GitHub Desktop.
Save xream/1582732 to your computer and use it in GitHub Desktop.
Mac VPN auto reconnect script
#!/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
@lowstz
Copy link

lowstz commented Feb 8, 2012

改了下能用,开心

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment