loops - Bash Exit Status codes for Ping -
i working on small script checks if host or down.
until [ "$status" -eq "0" ] ping -c 1 192.168.0.3 echo host down status=`echo $?` done
it supposed change status 0 if pings host , exit until loop. doesnt. if echo out value of $? value zero.
can me figure out please? :)
thanks in advance
you have echo host down
after ping
command. $?
takes exit status of echo
command not ping
command.
ping -c 1 192.168.0.3 status=$? if [ $status -ne 0 ]; echo "the host down" fi
Comments
Post a Comment