diff --git a/imageroot/actions/upload-certificate/22save_certificates b/imageroot/actions/upload-certificate/22save_certificates index 5d289f4..fd5f70a 100755 --- a/imageroot/actions/upload-certificate/22save_certificates +++ b/imageroot/actions/upload-certificate/22save_certificates @@ -20,6 +20,11 @@ cn_name=$(openssl x509 -noout -subject -nameopt=multiline -in $CERT_FILE | sed - cp $KEY_FILE "custom_certificates/$cn_name.key" cp $CERT_FILE "custom_certificates/$cn_name.crt" +#clenaup existing requested certificate if exists +if [ -f "configs/certificate-${cn_name}.yml" ]; then + rm -f "configs/certificate-${cn_name}.yml" +fi + # write configuration file for certificate cat >"configs/certificate_${cn_name}.yml" <