Update test.sh
This commit is contained in:
35
test.sh
35
test.sh
@@ -19,13 +19,30 @@ if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remot
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
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
|
show_time ${1}
|
||||||
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
|
|
||||||
Reference in New Issue
Block a user