summaryrefslogtreecommitdiff
path: root/configfiles.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-15 11:02:34 -0500
committerJeff Carr <[email protected]>2024-10-15 11:02:34 -0500
commit1c77ec7e63355cab48564a9fb49f34f55b5f0b15 (patch)
tree8d081863ea226465827f9d266b0e701da216220e /configfiles.go
parentaa6b142b7c156b8f1925eb4af10b0b371263a129 (diff)
start from the command line works
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'configfiles.go')
-rw-r--r--configfiles.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/configfiles.go b/configfiles.go
index b23cb0d..1bdf153 100644
--- a/configfiles.go
+++ b/configfiles.go
@@ -32,13 +32,16 @@ func readDropletFile(filename string) {
// this is a new unknown droplet (not in the config file)
d = new(DropletT)
d.Hostname = name
- if len(fields) < 2 || fields[1] != "ON" {
+ if len(fields) > 1 && fields[1] != "ON" {
d.State = "OFF"
} else {
d.State = "ON"
}
+ if len(fields) >= 3 {
+ d.hyperPreferred = fields[2]
+ }
me.droplets = append(me.droplets, d)
- log.Log(EVENT, "NEW CONFIG DROPLET", d.Hostname, d.State)
+ log.Log(EVENT, "NEW CONFIG DROPLET", d.Hostname, d.State, d.hyperPreferred)
} else {
log.Info("not sure what to do here. duplicate droplet", name, "in config file")
}