This is more a comment on the mikeB answer, but comments don't allow code so I'll post it as an answer:
You can use something like grep to find what you're looking for, such as
ip addr show dev eth0 | fgrep -q 'inet 192.168.1.1'
if [ $? -eq 0 ]; then
echo 'IP found'
echo 'IP not found'
This can actually be simplified getting rid of the test ( [ is an alias for test) on the exit status, because if already checks exit status directly, which is how test communicates with if already:
ifconfig | fgrep -q 'inet 192.168.1.1'
echo "IP Found"
echo "IP Not found"
And you can further simplify this by using the regex searches built into most bourne shells by using a case statement:
echo "IP found"
echo "IP not found"