Skip to content

Instantly share code, notes, and snippets.

@insparrow
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save insparrow/637d1f80f99e56e0f1f0 to your computer and use it in GitHub Desktop.
Save insparrow/637d1f80f99e56e0f1f0 to your computer and use it in GitHub Desktop.
Sets bash variable which holds internal / exteral IP address according to the SSID you are connected to
export SERVER=$(networksetup -getairportnetwork en0 | grep -q "HOME_SSID" && echo "INTERAL_IP" || echo "EXTERNAL_IP")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment