Guest User

Untitled

a guest
Dec 11th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. on vpnToggle(vpnName)
  2. tell application "System Events"
  3. tell current location of network preferences
  4. set VPNservice to service vpnName
  5. set isConnected to connected of current configuration of VPNservice
  6. if isConnected then
  7. disconnect VPNservice
  8. do shell script "./ip-down" with administrator privileges
  9. else
  10. do shell script "./ip-up" with administrator privileges
  11. connect VPNservice
  12. end if
  13. end tell
  14. end tell
  15. do shell script "dscacheutil -flushcache"
  16. end vpnToggle
Add Comment
Please, Sign In to add comment