config test
This commit is contained in:
@@ -15,9 +15,9 @@ import (
|
||||
type Config struct {
|
||||
Zfsnap map[string]string `json:"zfsnap"`
|
||||
Box map[string]*Box `json:"box"`
|
||||
Email EmailConfig `json:"email"`
|
||||
Apps []AppConfig `json:"apps"`
|
||||
Timezone string `json:"timezone"`
|
||||
Email EmailConfig `json:"email"`
|
||||
Now time.Time `json:"-"`
|
||||
}
|
||||
|
||||
@@ -50,6 +50,13 @@ func (c *Config) Load() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(cfg.Email.smtpHost) == 0 || len(cfg.Email.fromEmail) == 0 || len(cfg.Email.toEmail) == 0 {
|
||||
if *debugFlag {
|
||||
log.Printf("Config.Load : no email")
|
||||
}
|
||||
return fmt.Errorf("no email")
|
||||
}
|
||||
|
||||
c.Now = time.Now().In(l)
|
||||
|
||||
for k, v := range c.Box {
|
||||
|
||||
Reference in New Issue
Block a user