admin: Don't erase challenge.json if already exists

This commit is contained in:
nemunaire 2022-06-08 03:00:50 +02:00
parent cfde1689cc
commit 159672ec47

View File

@ -144,6 +144,7 @@ func main() {
log.Println("Using", sync.GlobalImporter.Kind())
// Update distributed challenge.json
if _, err := os.Stat(path.Join(settings.SettingsDir, settings.ChallengeFile)); os.IsNotExist(err) {
challengeinfo, err := sync.GetFileContent(sync.GlobalImporter, settings.ChallengeFile)
if err == nil {
if fd, err := os.Create(path.Join(settings.SettingsDir, settings.ChallengeFile)); err != nil {
@ -157,6 +158,7 @@ func main() {
}
}
}
}
// Sanitize options
var err error