summaryrefslogtreecommitdiff
path: root/doLinux.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-09 01:29:52 -0500
committerJeff Carr <[email protected]>2025-10-09 01:29:52 -0500
commit97fb72d696512cbe53502918ea059b4ab6fc9755 (patch)
tree880654594d4078f45082a0fbcb6c9b75edc4595e /doLinux.go
parentd78f8181ea0f09a9faadfebab99377f8b3f1b61c (diff)
make 'linux' subcommand
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
}