Created
April 21, 2015 04:14
-
-
Save auzwang/827090cae932a630966f to your computer and use it in GitHub Desktop.
bash extras
This file contains 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
function woff() { | |
# get current wifi device | |
CURRENT_DEVICE=$(networksetup -listallhardwareports | awk '$3=="Wi-Fi" {getline; print $2}') | |
echo "Current Wi-Fi Device = '$CURRENT_DEVICE'" | |
# turn off wifi | |
networksetup -setairportpower $CURRENT_DEVICE off | |
} | |
function won() { | |
# get current wifi device | |
CURRENT_DEVICE=$(networksetup -listallhardwareports | awk '$3=="Wi-Fi" {getline; print $2}') | |
echo "Current Wi-Fi Device = '$CURRENT_DEVICE'" | |
# turn on wifi | |
networksetup -setairportpower $CURRENT_DEVICE on | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment