Script to determine server IP

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,

if [[ "$IP" = @(10.10.3.*|10.10.6.*) ]]; then
   echo IPV4
else
   echo IPV6
fi

also:

IP=$(nslookup $(hostname -s) | awk '/^Name/ {n++}; n && /^Address/ {print $NF}')
IP=`hostname -i`
case $IP in
10.10.3.*|10.10.6.*)
  echo $IP
;;
esac

Thanks everyone for reply.

@MadeInGermany, I made little changes to your suggestion, it worked fine.

I cannot use `hostname -i`, I have to get IP from nslookup while server is under build stage.

#!/bin/bash
SHORT=`hostname -s`
IPCS=`nslookup $SHORT | egrep '10.10.3.*|10.10.6.*' | awk '{print $2}'`

case $IPCS in

10.10.3.*)
        echo "Client Server IP is $IPCS" ;;

10.10.6.*)
        echo "Client Server IP is $IPCS" ;;

esac