You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Added Option to parse in the npm value (I.E. npm-10) as a required variable which is the npm value that the certificate files are stored in (I.E. '/etc/letsencrypt/live/npm-10/' and '/etc/letsencrypt/archive/npm-10/' )
2. Added the option to parse a password into the script to be used as the p12 password for securing the private key within the generated PKCS12 file.
3. Added Variable in script to allow the user to keep the root certificate that the script generates ($KEEP_ROOT_CERTIFICATE which it is set to true by default).
4. Added Simlinks for the .p12 file (follows the current convention)
5. Added Simlink for the root certificate, if the user chooses to keep the root certificate by setting the variable $KEEP_ROOT_CERTIFICATE to true (follows the current convention)
4. Added automatic cleanup for temporary files as well as the root file when the variable $KEEP_ROOT_CERTIFICATE is set to false.
#Change the ownership to "$OWNER:$GROUP" for SimLink
447
+
chown -h "$OWNER:$GROUP""$PKCS12_SIMLINK_PATH"
348
448
349
449
if [[ $?-eq 0 ]]
350
450
then
351
-
echo-e "\nSuccessfully changed $PKCS12_SIMLINK_PATH User and Group ownership to npm"
451
+
echo" Successfully changed $PKCS12_SIMLINK_PATH User and Group ownership to $OWNER:$GROUP"
352
452
else
353
-
echo"\nERROR - Unable to change $PKCS12_SIMLINK_PATH User and Group ownership to npm"
453
+
echo"\nERROR - Unable to change $PKCS12_SIMLINK_PATH User and Group ownership to $OWNER:$GROUP"
354
454
exit 1
355
455
fi
356
456
357
-
#The Root Certificate that was created by this script is no longer needed after generating the .p12 file so add it to the array of temporary files to delete
358
-
TEMP_FILES_ARRAY+=("$ROOT_FULL_PATH") # Comment out if you want to keep the Root Certificate geenrated by this script (Generated from downloaing the root from the Intermediate CA Certificate).
457
+
if [[ "$KEEP_ROOT_CERTIFICATE"==false ]]
458
+
then
459
+
#The Root Certificate that was created by this script is no longer needed after generating the .p12 file so add it to the array of temporary files to delete
460
+
TEMP_FILES_ARRAY+=("$ROOT_FULL_PATH") # When $KEEP_ROOT_CERTIFICATE is set to true the script will keep the file and create a simlink for it as well
461
+
fi
359
462
360
463
echo -e "\n\nCleaning up temporary files..."
361
464
fortemp_filein"${TEMP_FILES_ARRAY[@]}"
@@ -370,6 +473,48 @@ then
370
473
echo -e " Successfully deleted '$temp_file'"
371
474
fi
372
475
done
476
+
477
+
#If the Root Path still exist then the user must have comented out the deletion of the root.pem file. So generate a simlink for it as well.
478
+
if [[ -f"$ROOT_FULL_PATH" ]]
479
+
then
480
+
echo -e "\nCreating SimLink for root certificate..."
481
+
#Change the ownership to "$OWNER:$GROUP"
482
+
chown "$OWNER:$GROUP""$ROOT_FULL_PATH"
483
+
484
+
# Get the directory where the symlink will be created
0 commit comments