Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on vpnToggle(vpnName)
- tell application "System Events"
- tell current location of network preferences
- set VPNservice to service vpnName
- set isConnected to connected of current configuration of VPNservice
- if isConnected then
- disconnect VPNservice
- do shell script "./ip-down" with administrator privileges
- else
- do shell script "./ip-up" with administrator privileges
- connect VPNservice
- end if
- end tell
- end tell
- do shell script "dscacheutil -flushcache"
- end vpnToggle
Add Comment
Please, Sign In to add comment