summaryrefslogtreecommitdiff
path: root/doRdate.go
diff options
context:
space:
mode:
Diffstat (limited to 'doRdate.go')
-rw-r--r--doRdate.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/doRdate.go b/doRdate.go
index 244b7c1..ac66119 100644
--- a/doRdate.go
+++ b/doRdate.go
@@ -3,9 +3,19 @@
package main
+import "go.wit.com/lib/fhelp"
+
func doRdate() {
checkSuperuser()
+ if _, err := fhelp.CheckCmd("rdate"); err != nil {
+ exitOnError([]string{"apt", "install", "rdate"})
+ }
+
+ if _, err := fhelp.CheckCmd("hwclock"); err != nil {
+ exitOnError([]string{"apt", "install", "util-linux-extra"})
+ }
+
exitOnError([]string{"rdate", "rdate.grid.wit.com"})
exitOnError([]string{"hwclock", "-w"})
}