mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 19:39:05 +00:00
Don't start when the config dir is not a dir
This commit is contained in:
parent
5d85a24977
commit
9ff04ee3d8
@ -248,6 +248,12 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
confDir = expandTilde(confDir)
|
||||||
|
|
||||||
|
if info, err := os.Stat(confDir); err == nil && !info.IsDir() {
|
||||||
|
l.Fatalln("Config directory", confDir, "is not a directory")
|
||||||
|
}
|
||||||
|
|
||||||
if os.Getenv("STNORESTART") != "" {
|
if os.Getenv("STNORESTART") != "" {
|
||||||
syncthingMain()
|
syncthingMain()
|
||||||
} else {
|
} else {
|
||||||
@ -266,8 +272,6 @@ func syncthingMain() {
|
|||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
}
|
}
|
||||||
|
|
||||||
confDir = expandTilde(confDir)
|
|
||||||
|
|
||||||
events.Default.Log(events.Starting, map[string]string{"home": confDir})
|
events.Default.Log(events.Starting, map[string]string{"home": confDir})
|
||||||
|
|
||||||
if _, err = os.Stat(confDir); err != nil && confDir == getDefaultConfDir() {
|
if _, err = os.Stat(confDir); err != nil && confDir == getDefaultConfDir() {
|
||||||
|
Loading…
Reference in New Issue
Block a user