@@ -37,7 +37,7 @@ TARGET_DISTRIBUTION=""
37
37
PACKAGE_INSTALLER=" "
38
38
NMS_NGINX_MGMT_BLOCK=" mgmt { \n usage_report endpoint=127.0.0.1 interval=30m; \n ssl_verify off; \n}" ;
39
39
NIM_FQDN=" "
40
-
40
+ NIM_CERTS_DIR= " /etc/nms/certs "
41
41
# Added to account for the renaming of the adc dimension from application to app.
42
42
if [ -f " /usr/share/nms/catalogs/dimensions/application.yml" ]; then
43
43
rm /usr/share/nms/catalogs/dimensions/application.yml
@@ -335,6 +335,7 @@ installBundleForDebianDistro() {
335
335
if [ " ${USE_SM_MODULE} " == " true" ]; then
336
336
nim_major_version=$( nms-core --version | grep -oE ' [0-9]+\.[0-9]+\.[0-9]+' | awk -F. ' {print $1}' )
337
337
nim_minor_version=$( nms-core --version | grep -oE ' [0-9]+\.[0-9]+\.[0-9]+' | awk -F. ' {print $2}' )
338
+ echo " Installed NIM major Version: ${nim_major_version} , minor Version:${nim_minor_version} "
338
339
if [[ $nim_major_version -ge 2 && $nim_minor_version -ge 19 ]]; then
339
340
echo " Note: NGINX Instance Manager version 2.19.0 or later comes with security monitoring installed. skipping installing security monitoring"
340
341
else
@@ -477,7 +478,8 @@ installBundleForRPMDistro(){
477
478
478
479
if [ " ${USE_SM_MODULE} " == " true" ]; then
479
480
nim_major_version=$( nms-core --version | grep -oE ' [0-9]+\.[0-9]+\.[0-9]+' | awk -F. ' {print $1}' )
480
- nim_minor_version=$( nms-core --version | grep -oE ' [0-9]+\.[0-9]+\.[0-9]+' | awk -F. ' {print $1}' )
481
+ nim_minor_version=$( nms-core --version | grep -oE ' [0-9]+\.[0-9]+\.[0-9]+' | awk -F. ' {print $2}' )
482
+ echo " Installed NIM major Version: ${nim_major_version} , minor Version:${nim_minor_version} "
481
483
if [[ $nim_major_version -ge 2 && $nim_minor_version -ge 19 ]]; then
482
484
echo " Note: NGINX Instance Manager version 2.19.0 or later comes with security monitoring installed. skipping installing security monitoring"
483
485
else
@@ -530,7 +532,11 @@ install_nim_online(){
530
532
exit 1
531
533
fi
532
534
if [[ -n ${NIM_FQDN} ]] ; then
533
- bash -c " source /etc/nms/scripts/certs.sh || /etc/nms/scripts/certs.sh 0 ${NIM_FQDN} "
535
+ if [ -d " ${NIM_CERTS_DIR} " ]; then
536
+ echo " removing existing NIM certs"
537
+ rm -rf " /etc/nms/certs"
538
+ fi
539
+ bash -c " source /etc/nms/scripts/certs.sh 0 \" ${NIM_FQDN} \" || /etc/nms/scripts/certs.sh 0 ${NIM_FQDN} "
534
540
fi
535
541
curl -s -o /dev/null --cert ${NGINX_CERT_PATH} --key ${NGINX_CERT_KEY_PATH} " https://pkgs.nginx.com/nms/?using_install_script=true&app=nim&mode=online"
536
542
}
@@ -1029,7 +1035,11 @@ else
1029
1035
exit 1
1030
1036
fi
1031
1037
if [[ -n ${NIM_FQDN} ]] ; then
1032
- bash -c " source /etc/nms/scripts/certs.sh || /etc/nms/scripts/certs.sh 0 ${NIM_FQDN} "
1038
+ if [ -d " ${NIM_CERTS_DIR} " ]; then
1039
+ echo " removing existing nim certs"
1040
+ rm -rf " /etc/nms/certs"
1041
+ fi
1042
+ bash -c " source /etc/nms/scripts/certs.sh 0 \" ${NIM_FQDN} \" || /etc/nms/scripts/certs.sh 0 ${NIM_FQDN} "
1033
1043
fi
1034
1044
curl -s -o /dev/null --cert ${NGINX_CERT_PATH} --key ${NGINX_CERT_KEY_PATH} " https://pkgs.nginx.com/nms/?using_install_script=true&app=nim&mode=offline"
1035
1045
fi
0 commit comments