Update test.sh
This commit is contained in:
7
test.sh
7
test.sh
@@ -23,9 +23,12 @@ CHECK_HOST(){
|
|||||||
ping -c 3 ${1} > /dev/null 2>&1
|
ping -c 3 ${1} > /dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo false
|
echo false
|
||||||
else echo true
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CHECK_HOST 10.5.10.53
|
if [ CHECK_HOST 10.5.10.53 = "false" ]; then
|
||||||
|
echo 'host down'
|
||||||
|
else
|
||||||
|
echo 'host up'
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user