Really fix openSUSE uptime command

This commit is contained in:
Dylan 2016-02-09 09:02:07 +11:00
parent 74d4943115
commit 9a3a3bc83d

7
fetch
View file

@ -501,11 +501,16 @@ getuptime () {
case "$os" in case "$os" in
"Linux") "Linux")
case "$distro" in case "$distro" in
"Puppy Linux"* | "Quirky Werewolf"* | "Precise Puppy"* | "openSUSE"*) "Puppy Linux"* | "Quirky Werewolf"* | "Precise Puppy"*)
uptime=$(uptime | awk -F ':[0-9]{2}+ |(, ){1}+' '{printf $2}') uptime=$(uptime | awk -F ':[0-9]{2}+ |(, ){1}+' '{printf $2}')
uptime=${uptime/ / } uptime=${uptime/ / }
;; ;;
"openSUSE"*)
uptime=$(uptime | awk -F ':[0-9]{2}+[a-z][a-z] |(, ){1}+' '{printf $2}')
uptime=${uptime/ / }
;;
*) *)
uptime="$(uptime -p)" uptime="$(uptime -p)"
;; ;;