28 lines
589 B
Go
28 lines
589 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"log"
|
|
"lux/host"
|
|
)
|
|
|
|
var configPath string
|
|
var isHost bool
|
|
var isNode bool
|
|
|
|
func main() {
|
|
flag.StringVar(&configPath, "config", "", "/etc/lux/lux-host.conf or /etc/lux/lux-node.conf")
|
|
flag.BoolVar(&isHost, "host", false, "act as LUX host")
|
|
flag.BoolVar(&isNode, "node", false, "act as LUX node")
|
|
flag.Parse()
|
|
|
|
if isHost {
|
|
if err := host.LuxHostEntry(configPath); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
} else if isNode {
|
|
log.Fatal("not yet implemented")
|
|
} else {
|
|
log.Fatal("You must specify either --host or --node with appropriate --config")
|
|
}
|
|
}
|