Update test.sh

This commit is contained in:
2019-02-07 22:32:12 -06:00
parent 8e01ab4a5c
commit ffb173e66f

35
test.sh
View File

@@ -19,13 +19,30 @@ if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remot
exit 0
fi
function show_time () {
num=$1
min=0
hour=0
day=0
if((num>59));then
((sec=num%60))
((num=num/60))
if((num>59));then
((min=num%60))
((num=num/60))
if((num>23));then
((hour=num%24))
((day=num/24))
else
((hour=num))
fi
else
((min=num))
fi
else
((sec=num))
fi
echo "$day"d "$hour"h "$min"m "$sec"s
}
declare -i errtime
errtime=`date +%s`-$(stat -c %Y /opt/idssys/nodemgmt/10.5.10.53-haproxy.down)
echo $errtime
# if [ "" -gt "$timeout" ]; then
# echo 'yes'
# else
# echo 'no'
# fi
show_time ${1}