Update test.sh

This commit is contained in:
2019-02-07 22:05:34 -06:00
parent 65463b53be
commit 0f1e0ffa19

19
test.sh
View File

@@ -26,12 +26,13 @@ CHECK_HOST(){
fi
}
#check=`ssh root@10.5.10.53 "systemctl is-active --quiet haproxy && echo true"`
#echo "HERE: '${check}'"
srvc=haproxy
#if [ "$(ssh root@10.5.10.53 'systemctl is-active --quiet haproxy && echo true')" = "true" ]; then
if [ "$(ssh root@10.5.10.53 systemctl is-active ${srvc})" = "active" ]; then
echo 'yes'
else
echo 'no'
fi
errtime=$(stat -c %Y /opt/idssys/nodemgmt/10.5.10.53-haproxy.down)
timediff=`date +%s`-$errtime
echo $errtime
echo `date +%s`
echo $timediff
# if [ "" -gt "$timeout" ]; then
# echo 'yes'
# else
# echo 'no'
# fi