199 |
|
# work out the days, hours, and minutes |
200 |
|
if ($uptime =~ /hr/) { |
201 |
|
# 0 minutes |
202 |
< |
$uptime =~ /up ([0-9]+) .*, ([0-9]+) .*,/; |
203 |
< |
$uptime = "$1:$2:0"; |
202 |
> |
$uptime =~ s/up ([0-9]+) .*, ([0-9]+) .*,/$1:$2:0/; |
203 |
|
} |
204 |
|
elsif ($uptime =~ /min/) { |
205 |
|
# 0 hours |
206 |
< |
$uptime =~ /up ([0-9]+) .*, ([0-9]+) .*,/; |
208 |
< |
$uptime = "$1:0:$2"; |
206 |
> |
$uptime =~ s/up ([0-9]+) .*, ([0-9]+) .*,/$1:0:$2/; |
207 |
|
} |
208 |
|
elsif ($uptime =~ /day/) { |
209 |
|
# normal |
210 |
< |
$uptime =~ /up ([0-9]+) .*, ([0-9]+):([0-9]+)/; |
213 |
< |
$uptime = "$1:$2:$3"; |
210 |
> |
$uptime =~ s/up ([0-9]+) .*, ([0-9]+):([0-9]+)/$1:$2:$3/; |
211 |
|
} |
212 |
|
else { |
213 |
|
# 0 days |
214 |
< |
$uptime =~ /up ([0-9]+):([0-9]+)/; |
218 |
< |
$uptime = "0:$1:$2"; |
214 |
> |
$uptime =~ s/up ([0-9]+):([0-9]+)/0:$1:$2/; |
215 |
|
} |
216 |
|
|
217 |
|
# turn into minutes |