Find your ip with Bash
Page content
I only wanted to run a script if the machine had a specific network access so i constructed this below.
How to find the machines ip address
ifconfig eth0 | grep "inet addr" | awk -F: '{ print $2 }' | awk '{ print $1 }'
ifconfig eth0 | grep "inet addr" | awk -F: '{ print $2 }' | awk '{ print $1 }' | grep -qE '172\.24|25\.[0-9]{1,3}\.[0-9]{1,3}' ; echo $?