#!/usr/bin/ksh

echo "Reconfigurng the network ..."

while [ 0 = 0 ]  ; do
     for i in 0 1 2 ; do
           ping 192.168.1.1 1 >/dev/null   
           if [ $? -ne 0 ] ; then

                svcadm restart svc:/network/physical:nwam
            sleep 5 
        else
            exit 0
        fi
    done
    echo ""
    echo "Error reconfiguring the network."
    echo "Press y<enter> to try again or <enter> to close the window"; 
    read test
    [ "$test"x != "y"x ] && break
    echo ""
done

