Update test.sh
This commit is contained in:
18
test.sh
18
test.sh
@@ -19,18 +19,6 @@ if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remot
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
t=''
|
||||
if [ $day != 0 ]; then t+="${day}days, "; fi
|
||||
if [ $hour != 0 ]; then t+="${hour}hours, "; fi
|
||||
if [ $min != 0 ]; then t+="${min}mins"; fi
|
||||
echo ${t}
|
||||
}
|
||||
|
||||
show_time ${1}
|
||||
toterrtime=`date +%s`-$(stat -c %Y /opt/idssys/nodemgmt/10.5.10.53-haproxy.down)
|
||||
#show_time ${toterrtime}
|
||||
echo "has been down for $(show_time ${toterrtime})"
|
||||
|
||||
Reference in New Issue
Block a user