Uptime [HP-UX]: Remove leading zeroes

Variables with a leading 0 are treated as base-8, so it halts HP-UX
detection because of the error.
This commit is contained in:
Muhammad Herdiansyah 2017-07-05 02:19:52 +07:00
parent 01bbad7c79
commit b8c902e65f

View file

@ -403,6 +403,7 @@ get_uptime() {
d="0" h="0"
case "$t" in *"-"*) d="${t%%-*}"; t="${t#*-}";; esac
case "$t" in *":"*":"*) h="${t%%:*}"; t="${t#*:}";; esac
h="${h#0}" t="${t#0}"
seconds="$((d*86400 + h*3600 + ${t%%:*}*60 + ${t#*:}))"
;;
esac