renamed env

This commit is contained in:
cupcakearmy 2021-10-25 18:02:45 +02:00
parent 02a8e461d4
commit 048a5ffed8
No known key found for this signature in database
GPG Key ID: D28129AE5654D9D9
1 changed files with 2 additions and 1 deletions

View File

@ -89,7 +89,8 @@ func (b Backend) getKey() (string, error) {
if b.Key != "" {
return b.Key, nil
}
if key, found := os.LookupEnv("AUTORESTIC_KEY_" + strings.ToUpper(b.name)); found {
keyName := "AUTORESTIC_" + strings.ToUpper(b.name) + "_KEY"
if key, found := os.LookupEnv(keyName); found {
return key, nil
}
return "", fmt.Errorf("no key found for backend \"%s\"", b.name)