Skip to content

Instantly share code, notes, and snippets.

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