Skip to content

Instantly share code, notes, and snippets.

@Joilence
Last active January 9, 2020 08:55
Show Gist options
  • Save Joilence/17bcc5f95b9e7b41a3e6a390824afc2d to your computer and use it in GitHub Desktop.
Save Joilence/17bcc5f95b9e7b41a3e6a390824afc2d to your computer and use it in GitHub Desktop.
Toggle WiFi on macOS
set status to do shell script "networksetup -getairportpower en0"
if status ends with "On" then
do shell script "networksetup -setairportpower en1 off"
else
do shell script "networksetup -setairportpower en1 on"
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment