Created
March 26, 2013 08:26
-
-
Save yasyf/5243876 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
show_usage(){ | |
echo "Usage: airplanemode on|off" | |
} | |
case $1 in | |
"-h"|"--help") show_usage; exit 1; ;; | |
esac | |
MINARGS=1 | |
ARGC=$# | |
if [[ $ARGC -lt $MINARGS ]] ; then | |
show_usage | |
exit 1; | |
fi | |
on(){ | |
networksetup -setairportpower en0 off | |
} | |
off(){ | |
networksetup -setairportpower en0 on | |
} | |
if [[ $1 == "on" ]]; then | |
on | |
elif [[ $1 == "off" ]]; then | |
off | |
else | |
show_usage | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment