summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..5264b69
--- /dev/null
+++ b/main.go
@@ -0,0 +1,39 @@
+// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
+// Use of this source code is governed by the GPL 3.0
+
+package main
+
+import (
+ "os"
+ "time"
+
+ "go.wit.com/dev/alexflint/arg"
+ "go.wit.com/log"
+)
+
+var VERSION string
+var BUILDTIME string
+
+func main() {
+ var pp *arg.Parser
+ pp = arg.MustParse(&argv)
+
+ if pp == nil {
+ pp.WriteHelp(os.Stdout)
+ os.Exit(0)
+ }
+
+ me := new(gusconf)
+ me.pollDelay = 10 * time.Second
+
+ if argv.Daemon {
+ // turn off timestamps for STDOUT (systemd adds them)
+ log.DaemonMode(true)
+ startHTTP()
+ os.Exit(0)
+ }
+
+ // go NewWatchdog()
+
+ startHTTP()
+}