Fix bug with 0 amount

This commit is contained in:
Dylan 2016-03-26 10:06:08 +11:00
parent eefca64248
commit 1c8b71fb90
1 changed files with 6 additions and 6 deletions

View File

@ -587,21 +587,21 @@ getuptime () {
# Format the output like Linux's "uptime -p" cmd.
if [ "$mins" == 1 ]; then
mins+=" minute"
mins="$mins minute"
elif [ "$mins" != 0 ]; then
mins+=" minutes"
mins="$mins minutes"
fi
if [ "$hours" == 1 ]; then
hours+=" hour,"
hours="$hours hour,"
elif [ "$mins" != 0 ]; then
hours+=" hours,"
hours="$hours hours,"
fi
if [ "$days" == 1 ]; then
days+=" day,"
days="$days day,"
elif [ "$days" != 0 ]; then
days+=" days,"
days="$days days,"
fi
uptime="up $days $hours $mins"