Need help with the script, I am trying to include this script as part of kickstart profile.
based of the host's IP address, in this case if the host is IP starting with 10.10.3.* or 10.10.6.*, I will be pushing appropriate routing file from my web server.
I validate host IP from nslookup.
#!/bin/bash
SHORT=`hostname -s`
IP=`nslookup $SHORT | grep 10.10.3 | awk '{print $2}'`
if [ $IP -eq ^10.10.3 ]
then
echo "Server has $IP IP address"
else
IP6=`nslookup $SHORT | grep 10.10.6 | awk '{print $2}'`
echo "sever has $IP6 IP address"
fi
it is failing with this error message, please suggest.
# /tmp/csip
/tmp/csip: line 4: [: 10.10.3.13: integer expression expected
sever has IP address
Thanks,