Skip to content

Instantly share code, notes, and snippets.

@gjpalau
Created January 31, 2015 02:25
Show Gist options
  • Save gjpalau/c63e2a591332523c2388 to your computer and use it in GitHub Desktop.
Save gjpalau/c63e2a591332523c2388 to your computer and use it in GitHub Desktop.
#!/bin/bash
AIRPORT="en1"
USER="$USER"
if [ "$USER" = Public ]; then
networksetup -removeallpreferredwirelessnetworks
ifconfig en0 up
echo "Ethernet is now turned on"
networksetup -setairportpower en1 off
echo "Airport is now turned off."
exit 0
else
networksetup -setairportpower en1 on
echo "Airport is turned on."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment