@@ -37,7 +37,7 @@ TARGET_DISTRIBUTION=""
3737PACKAGE_INSTALLER=" "
3838NMS_NGINX_MGMT_BLOCK=" mgmt { \n usage_report endpoint=127.0.0.1 interval=30m; \n ssl_verify off; \n}" ;
3939NIM_FQDN=" "
40-
40+ NIM_CERTS_DIR= " /etc/nms/certs "
4141# Added to account for the renaming of the adc dimension from application to app.
4242if [ -f " /usr/share/nms/catalogs/dimensions/application.yml" ]; then
4343 rm /usr/share/nms/catalogs/dimensions/application.yml
@@ -335,6 +335,7 @@ installBundleForDebianDistro() {
335335 if [ " ${USE_SM_MODULE} " == " true" ]; then
336336 nim_major_version=$( nms-core --version | grep -oE ' [0-9]+\.[0-9]+\.[0-9]+' | awk -F. ' {print $1}' )
337337 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} "
338339 if [[ $nim_major_version -ge 2 && $nim_minor_version -ge 19 ]]; then
339340 echo " Note: NGINX Instance Manager version 2.19.0 or later comes with security monitoring installed. skipping installing security monitoring"
340341 else
@@ -477,7 +478,8 @@ installBundleForRPMDistro(){
477478
478479 if [ " ${USE_SM_MODULE} " == " true" ]; then
479480 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} "
481483 if [[ $nim_major_version -ge 2 && $nim_minor_version -ge 19 ]]; then
482484 echo " Note: NGINX Instance Manager version 2.19.0 or later comes with security monitoring installed. skipping installing security monitoring"
483485 else
@@ -530,7 +532,11 @@ install_nim_online(){
530532 exit 1
531533 fi
532534 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} "
534540 fi
535541 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"
536542}
@@ -1029,7 +1035,11 @@ else
10291035 exit 1
10301036 fi
10311037 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} "
10331043 fi
10341044 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"
10351045 fi
0 commit comments