diff --git a/certman.sh b/certman.sh index 34b2de4..9f5a82d 100755 --- a/certman.sh +++ b/certman.sh @@ -89,7 +89,6 @@ download_and_verify_cert() { local temp_key="$TEMP_DIR/$domain.key" local temp_pem="$TEMP_DIR/$domain.pem" - echo -e "${BLUE}Processing certificate for $domain${NC}" # Download certificate @@ -178,14 +177,14 @@ install_certificate() { return 1 fi local files=("$final_pem") - else - if ! cp -f "$temp_cert" "$final_cert" || ! cp -f "$temp_key" "$final_key"; then - echo -e "${RED}Failed to install certificate files for $domain${NC}" - return 1 - fi - local files=("$final_cert" "$final_key") fi + if ! cp -f "$temp_cert" "$final_cert" || ! cp -f "$temp_key" "$final_key"; then + echo -e "${RED}Failed to install certificate files for $domain${NC}" + return 1 + fi + local files=("$final_cert" "$final_key") + # Set permissions and ownership for file in "${files[@]}"; do if ! chown "$CERT_OWNER:$CERT_GROUP" "$file" || \