Skip to content

Instantly share code, notes, and snippets.

@yasyf
Created March 26, 2013 08:26
Show Gist options
  • Save yasyf/5243876 to your computer and use it in GitHub Desktop.
Save yasyf/5243876 to your computer and use it in GitHub Desktop.
#!/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