Find your ip with Bash
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 }' Then find out if its on a network we care about ifconfig eth0 | grep "inet addr" | awk -F: '{ print $2 }' | awk '{ print $1 }' | grep -qE '172\.