Skip to content

Instantly share code, notes, and snippets.

@Cloudxtreme
Forked from gjpalau/logoutscript.sh
Created June 1, 2016 22:13
Show Gist options
  • Save Cloudxtreme/a053cf4df805588a258871909b53d71f to your computer and use it in GitHub Desktop.
Save Cloudxtreme/a053cf4df805588a258871909b53d71f 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