summaryrefslogtreecommitdiff
path: root/doLinux.go
diff options
context:
space:
mode:
Diffstat (limited to 'doLinux.go')
-rw-r--r--doLinux.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/doLinux.go b/doLinux.go
index 42db562..66ce02b 100644
--- a/doLinux.go
+++ b/doLinux.go
@@ -20,7 +20,12 @@ func doUptime() {
exitOnError([]string{"journalctl", "-b", "-1"}) // the last boot log
}
-func doRdate() {
+func doRdate() (string, error) {
+ if !debian.AreRoot() {
+ exitOnError([]string{"rdate", "-p", "rdate.grid.wit.com"})
+ exitOnError([]string{"date"})
+ return "rdate ok", nil
+ }
checkSuperuser()
if _, err := fhelp.CheckCmd("rdate"); err != nil {
@@ -33,4 +38,5 @@ func doRdate() {
exitOnError([]string{"rdate", "rdate.grid.wit.com"})
exitOnError([]string{"hwclock", "-w"})
+ return "", nil
}