Fixed whitespace issue and name issue with OS X uptime
This commit is contained in:
parent
62db9ad83a
commit
b0e9cc4782
|
@ -162,3 +162,12 @@ Here's what's on my todo list
|
||||||
|
|
||||||
#### Fill
|
#### Fill
|
||||||
![fill](https://imgur.com/LvxYwki.png)
|
![fill](https://imgur.com/LvxYwki.png)
|
||||||
|
|
||||||
|
|
||||||
|
### Thanks
|
||||||
|
|
||||||
|
Thanks to:
|
||||||
|
|
||||||
|
- Screenfetch: I've used some snippets as a base for a few functions in this script
|
||||||
|
|
||||||
|
- @jrgz: Helping me test the Mac OS X version.
|
||||||
|
|
20
fetch.sh
20
fetch.sh
|
@ -267,13 +267,23 @@ getuptime () {
|
||||||
hours=$((${uptime}/3600%24))
|
hours=$((${uptime}/3600%24))
|
||||||
days=$((${uptime}/86400))
|
days=$((${uptime}/86400))
|
||||||
|
|
||||||
uptime="up ${mins} minutes"
|
case "$mins" in
|
||||||
|
0) ;;
|
||||||
|
1) uptime="up ${mins} minute" ;;
|
||||||
|
*) uptime="up ${mins} minutes" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
[ "${hours}" -ne 0 ] && \
|
case "$hours" in
|
||||||
uptime="up ${hours} hours, ${uptime/up/}"
|
0) ;;
|
||||||
|
1) uptime="up ${hours} hour, ${uptime/up /}" ;;
|
||||||
|
*) uptime="up ${hours} hours, ${uptime/up /}" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
[ "${days}" -ne 0 ] && \
|
case "$days" in
|
||||||
uptime="up ${days} days, ${uptime/up/}"
|
0) ;;
|
||||||
|
1) uptime="up ${days} day, ${uptime/up /}" ;;
|
||||||
|
*) uptime="up ${days} days, ${uptime/up /}" ;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"OpenBSD")
|
"OpenBSD")
|
||||||
|
|
Reference in New Issue