diff options
| author | Jeff Carr <[email protected]> | 2025-10-09 01:29:52 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-09 01:29:52 -0500 |
| commit | 97fb72d696512cbe53502918ea059b4ab6fc9755 (patch) | |
| tree | 880654594d4078f45082a0fbcb6c9b75edc4595e /doLinux.go | |
| parent | d78f8181ea0f09a9faadfebab99377f8b3f1b61c (diff) | |
make 'linux' subcommand
Diffstat (limited to 'doLinux.go')
| -rw-r--r-- | doLinux.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 } |
