Skip to content

Instantly share code, notes, and snippets.

@BallisticPain
Created June 29, 2012 23:49
Show Gist options
  • Save BallisticPain/3021476 to your computer and use it in GitHub Desktop.
Save BallisticPain/3021476 to your computer and use it in GitHub Desktop.
CURRENT_IP Environment Variable

Debian method

export CURRENT_IP=`/sbin/ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`

Archlinux method

export CURRENT_IP=`/sbin/ifconfig  | grep 'inet '| grep -v '127.0.0.1' | cut -d' ' -f10 | awk '{ print $1}'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment