Last active
August 29, 2015 13:57
-
-
Save boywhoroared/9434099 to your computer and use it in GitHub Desktop.
Setup your OS X environment based on your "location" by checking the WiFi network you're connected to.
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 | |
# the name of your Wireless interface. Might be en1 on some machines. | |
AIRPORT="en0" | |
# name of the wifi network | |
WIFI_WORK="<name-of-your-office-wifi>"; | |
if networksetup -getairportnetwork $AIRPORT | grep -i -a $WIFI_WORK ; | |
then | |
# commit using my office credentials | |
export GIT_AUTHOR_NAME="<Your Name>" | |
export GIT_AUTHOR_EMAIL="<Your Email>" | |
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" | |
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment