fix: pull down crt, key and pem in one operation
This commit is contained in:
parent
5edef1fe64
commit
5c706ba5d4
1 changed files with 6 additions and 7 deletions
13
certman.sh
13
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" || \
|
||||
|
|
Loading…
Add table
Reference in a new issue