diff --git a/config/config.go b/config/config.go index 238bc67..137b7f4 100644 --- a/config/config.go +++ b/config/config.go @@ -175,6 +175,17 @@ func (c *Config) UpdateFromJSON(j []byte) error { } } + // check destinations + for _, dest := range newConfig.Destinations { + s, err := os.Stat(dest.Path) + if err != nil { + return fmt.Errorf("destination '%s' (%s) is bad: %s", dest.Name, dest.Path, err) + } + if !s.IsDir() { + return fmt.Errorf("destination '%s' (%s) is not a directory", dest.Name, dest.Path) + } + } + *c = newConfig return nil } diff --git a/web/config.html b/web/config.html index 1c5e8cd..72be425 100644 --- a/web/config.html +++ b/web/config.html @@ -114,8 +114,9 @@