Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
Iker Höek
byIker Höek, February 6, 2013
2 of 2 people found this review helpful
Works as expected when uptime is higher than a day.
When it is not, the output looks like this:
"System Uptime - up 11 Hours, 16, 2 users Minutes"
I just put the line 7 inside an if that checks if there is an instance of "day" in the variable and formats accordingly:
if [[ $struptime == *day* ]]; then
struptime1=${struptime%,}
else
struptime1=${struptime%, *}
fi
I hope it helps =)
When it is not, the output looks like this:
"System Uptime - up 11 Hours, 16, 2 users Minutes"
I just put the line 7 inside an if that checks if there is an instance of "day" in the variable and formats accordingly:
if [[ $struptime == *day* ]]; then
struptime1=${struptime%,}
else
struptime1=${struptime%, *}
fi
I hope it helps =)