Last active
February 9, 2018 04:15
-
-
Save sathishvj/87ac391577727fcd3add3da570db39da to your computer and use it in GitHub Desktop.
Toggle Mac/OSX wifi from command line
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
# add this to your .profile or .bashrc or other. | |
alias wifitoggle='echo -n "Previous status: " && networksetup -getairportpower en0 | grep "Wi-Fi"; networksetup -getairportpower en0 | grep -q "On" && networksetup -setairportpower en0 off || networksetup -setairportpower en0 on; echo -n "New status: " && networksetup -getairportpower en0 | grep "Wi-Fi"; ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment