Added a configurable update interval for WWClient

This commit is contained in:
Gregory Kurtzer
2020-12-03 19:14:40 -08:00
parent e30728b16d
commit df96dee6be
3 changed files with 11 additions and 5 deletions

View File

@@ -91,6 +91,10 @@ func main() {
log.Printf("ERROR: Failed running CPIO: %s\n", err)
}
time.Sleep(30000 * time.Millisecond)
if conf.Warewulf.UpdateInterval > 0 {
time.Sleep(time.Duration(conf.Warewulf.UpdateInterval*1000) * time.Millisecond)
} else {
time.Sleep(30000 * time.Millisecond * 1000)
}
}
}

View File

@@ -3,6 +3,7 @@ netmask: 255.255.255.0
warewulf:
port: 9873
secure: true
update interval: 60
dhcp:
enabled: true
range start: 192.168.1.150

View File

@@ -20,10 +20,11 @@ type ControllerConf struct {
}
type WarewulfConf struct {
Port int `yaml:"port,omitempty"`
Secure bool `yaml:"secure,omitempty"`
Enable string `yaml:"enable command,omitempty"`
Restart string `yaml:"restart command,omitempty"`
Port int `yaml:"port,omitempty"`
Secure bool `yaml:"secure,omitempty"`
Enable string `yaml:"enable command,omitempty"`
Restart string `yaml:"restart command,omitempty"`
UpdateInterval int `yaml:"update interval,omitempty"`
}
type DhcpConf struct {