Commit 3d97f15fefa7415ef15ea82f632a10d23fde9517

Thomas de Grivel 2018-07-03T11:25:36

fix uptime on linux

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/core/syntaxes.lisp b/core/syntaxes.lisp
index b799700..962f36a 100644
--- a/core/syntaxes.lisp
+++ b/core/syntaxes.lisp
@@ -68,7 +68,7 @@
 ;;  Host
 
 (defun parse-uptime (string)
-  (or (re-bind #~|^\s*([0-9]+ days,\s*)?([0-9]+):([0-9]+)\s*$|
+  (or (re-bind #~|^\s*([0-9]+ days?,\s*)?([0-9]+):([0-9]+)\s*$|
           (d h m) string
         (let* ((im (if m (parse-integer m) 0))
                (ih (if h (parse-integer h) 0))
@@ -87,5 +87,5 @@
                           (#'parse-uptime uptime)
                           (#'parse-integer users)
                           (#'parse-number load1 load5 load15))
-  #~|^\s*(\S+)\s+up\s+(.+), ([0-9]+) users?, load averages: ([0-9.]+), ([0-9.]+), ([0-9.]+)$|
+  #~|^\s*(\S+)\s+up\s+(.+),\s+([0-9]+)\s+users?,\s+load averages?: ([0-9.,]+), ([0-9.,]+), ([0-9.,]+)$|
   "Syntax of the uptime command output. See uptime(1).")