_debug DOMAIN_PATH "$DOMAIN_PATH"
fi
+ if [ -z "$DOMAIN_BACKUP_PATH" ]; then
+ DOMAIN_BACKUP_PATH="$DOMAIN_PATH"
+ fi
+
if [ -z "$DOMAIN_CONF" ]; then
DOMAIN_CONF="$DOMAIN_PATH/$domain.conf"
fi
_info "Installing cert to:$Le_RealCertPath"
if [ -f "$Le_RealCertPath" ] && [ ! "$IS_RENEW" ]; then
- cp "$Le_RealCertPath" "$Le_RealCertPath".bak
+ cp "$Le_RealCertPath" "$DOMAIN_BACKUP_PATH/cert.bak"
fi
cat "$CERT_PATH" >"$Le_RealCertPath"
fi
cat "$CA_CERT_PATH" >>"$Le_RealCACertPath"
else
if [ -f "$Le_RealCACertPath" ] && [ ! "$IS_RENEW" ]; then
- cp "$Le_RealCACertPath" "$Le_RealCACertPath".bak
+ cp "$Le_RealCACertPath" "$DOMAIN_BACKUP_PATH/ca.bak"
fi
cat "$CA_CERT_PATH" >"$Le_RealCACertPath"
fi
_info "Installing key to:$Le_RealKeyPath"
if [ -f "$Le_RealKeyPath" ] && [ ! "$IS_RENEW" ]; then
- cp "$Le_RealKeyPath" "$Le_RealKeyPath".bak
+ cp "$Le_RealKeyPath" "$DOMAIN_BACKUP_PATH/key.bak"
fi
cat "$CERT_KEY_PATH" >"$Le_RealKeyPath"
fi
_info "Installing full chain to:$Le_RealFullChainPath"
if [ -f "$Le_RealFullChainPath" ] && [ ! "$IS_RENEW" ]; then
- cp "$Le_RealFullChainPath" "$Le_RealFullChainPath".bak
+ cp "$Le_RealFullChainPath" "$DOMAIN_BACKUP_PATH/fullchain.bak"
fi
cat "$CERT_FULLCHAIN_PATH" >"$Le_RealFullChainPath"
fi