fs/config: Add method to reload configfile from disk

Fixes #3268
This commit is contained in:
Maran
2019-06-19 14:47:54 +01:00
committed by Nick Craig-Wood
parent 5935cb0a29
commit ba72e62b41
2 changed files with 29 additions and 0 deletions
+10
View File
@@ -1340,6 +1340,16 @@ func FileDeleteKey(section, key string) bool {
var matchEnv = regexp.MustCompile(`^RCLONE_CONFIG_(.*?)_TYPE=.*$`)
// FileRefresh ensures the latest configFile is loaded from disk
func FileRefresh() error {
reloadedConfigFile, err := loadConfigFile()
if err != nil {
return err
}
configFile = reloadedConfigFile
return nil
}
// FileSections returns the sections in the config file
// including any defined by environment variables.
func FileSections() []string {