update
This commit is contained in:
@@ -165,7 +165,7 @@ NM_BACKUP_ITEMS['fail2ban']=/etc/fail2ban
|
||||
GET-CHECKCERT-DOMAINS(){
|
||||
declare -A CHECKCERT_DOMAINS
|
||||
IFS=$'\n'
|
||||
for LINE in `egrep -v '(^#|^$)' ${NM_FOLDER}/ssl-domain-checks.conf`; do
|
||||
for LINE in `egrep -v '(^#|^$)' ${NM_FOLDER}/conf/ssl-domain-checks.conf`; do
|
||||
HOST=${LINE%% *}
|
||||
PORT=${LINE#* }
|
||||
IFS=" "
|
||||
|
||||
@@ -182,7 +182,7 @@ LISTCERTS(){
|
||||
declare -i cw; declare -i spc1; declare -i c
|
||||
declare -A CHECKCERT_DOMAINS
|
||||
IFS=$'\n'
|
||||
for LINE in `egrep -v '(^#|^$)' ${NM_FOLDER}/ssl-domain-checks.conf`; do
|
||||
for LINE in `egrep -v '(^#|^$)' ${NM_FOLDER}/conf/ssl-domain-checks.conf`; do
|
||||
HOST=${LINE%% *}
|
||||
PORT=${LINE#* }
|
||||
IFS=" "
|
||||
@@ -261,7 +261,7 @@ LISTCERTS_NPM(){
|
||||
declare -i cw; declare -i spc1; declare -i c
|
||||
declare -A CHECKCERT_DOMAINS
|
||||
IFS=$'\n'
|
||||
for LINE in `egrep -v '(^#|^$)' ${NM_FOLDER}/ssl-domain-checks.conf`; do
|
||||
for LINE in `egrep -v '(^#|^$)' ${NM_FOLDER}/conf/ssl-domain-checks.conf`; do
|
||||
HOST=${LINE%% *}
|
||||
PORT=${LINE#* }
|
||||
IFS=" "
|
||||
@@ -395,13 +395,13 @@ CHECK_NPMCERTS(){
|
||||
CHECK-CERTS(){
|
||||
if [ "${1}" == "check" ]; then
|
||||
rm -f ${NM_FOLDER}/ssl-cert-check.lastrun
|
||||
${NM_FOLDER}/ssl-cert-check/ssl-cert-check -f ${NM_FOLDER}/ssl-domain-checks.conf > ${NM_FOLDER}/ssl-cert-check.lastrun
|
||||
${NM_FOLDER}/ssl-cert-check/ssl-cert-check -f ${NM_FOLDER}/conf/ssl-domain-checks.conf > ${NM_FOLDER}/ssl-cert-check.lastrun
|
||||
SSLLOG="$(cat ${NM_FOLDER}/ssl-cert-check.lastrun)"
|
||||
SENDNOTICE "SSL Certs Check" "SSL Certs Check\n$SSLLOG"
|
||||
else
|
||||
# ${NM_FOLDER}/ssl-cert-check/ssl-cert-check -f ${NM_FOLDER}/ssl-domain-checks.conf
|
||||
# ${NM_FOLDER}/ssl-cert-check/ssl-cert-check -f ${NM_FOLDER}/conf/ssl-domain-checks.conf
|
||||
IFS=$'\n'
|
||||
for LINE in `egrep -v '(^#|^$)' ${NM_FOLDER}/ssl-domain-checks.conf`; do
|
||||
for LINE in `egrep -v '(^#|^$)' ${NM_FOLDER}/conf/ssl-domain-checks.conf`; do
|
||||
HOST=${LINE%% *}
|
||||
PORT=${LINE#* }
|
||||
CERTINFO=$(${NM_FOLDER}/ssl-cert-check/ssl-cert-check -p ${PORT} -s ${HOST} -N)
|
||||
|
||||
@@ -358,7 +358,7 @@ NODEUPDATE() {
|
||||
echo -en " ~ ${idsCL[LightCyan]}NodeMGMT${idsCL[Default]} : "
|
||||
if ! ${NCMD} command -v nodemgmt > /dev/null; then
|
||||
${NCMD} "bash <(curl -sL https://go.scity.us/install-nodemgmt)" >/dev/null 2>&1
|
||||
ssh -tq root@${nmip} rsync -az ${NM_FOLDER}/conf/defaults.local.inc root@${nip}:${NM_FOLDER}/ >/dev/null 2>&1
|
||||
ssh -tq root@${nmip} rsync -az ${NM_FOLDER}/conf/defaults.local.inc ${NM_FOLDER}/conf/ssl-domain-checks.conf root@${nip}:${NM_FOLDER}/ >/dev/null 2>&1
|
||||
echo -e "${idsCL[Green]}Installed & Synced${idsCL[Default]}"
|
||||
else
|
||||
${NCMD} "nodemgmt update q"
|
||||
@@ -375,7 +375,7 @@ NODEUPDATE() {
|
||||
else
|
||||
echo -en " ~ ${idsCL[LightCyan]}Sync Defaults${idsCL[Default]} : "
|
||||
if ssh -tq root@${nip} [[ ! -f ${NM_FOLDER}/conf/defaults.local.inc ]] || [ ${nmdiv} -ne $(ssh -tq root@${nip} ls -l --time-style=+%s ${NM_FOLDER}/conf/defaults.local.inc | cut -d ' ' -f 6) ]; then
|
||||
ssh -tq root@${nmip} rsync -az ${NM_FOLDER}/conf/defaults.local.inc ${NM_FOLDER}/ssl-domain-checks.conf root@${nip}:${NM_FOLDER}/ >/dev/null 2>&1
|
||||
ssh -tq root@${nmip} rsync -az ${NM_FOLDER}/conf/defaults.local.inc ${NM_FOLDER}/conf/ssl-domain-checks.conf root@${nip}:${NM_FOLDER}/ >/dev/null 2>&1
|
||||
echo -e "${idsCL[Green]}NodeMgmt Defaults File Synced${idsCL[Default]}"
|
||||
else
|
||||
echo -e "${idsCL[Green]}NodeMgmt Defaults File Already Synced${idsCL[Default]}"
|
||||
|
||||
5
run.sh
5
run.sh
@@ -1,9 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# NodeMgmt Loader
|
||||
|
||||
if [ -f /opt/idssys/settings/nodemgmt.conf ]; then
|
||||
mv /opt/idssys/settings/nodemgmt.conf /opt/idssys/nodemgmt/conf/settings.conf
|
||||
fi
|
||||
[ -f /opt/idssys/nodemgmt/settings.conf ] && mv /opt/idssys/nodemgmt/settings.conf /opt/idssys/nodemgmt/conf/settings.conf
|
||||
[ -f /opt/idssys/nodemgmt/defaults.local.inc ] && mv /opt/idssys/nodemgmt/defaults.local.inc /opt/idssys/nodemgmt/conf/defaults.local.inc
|
||||
|
||||
source /opt/idssys/defaults/colors.inc
|
||||
source /opt/idssys/defaults/default.inc
|
||||
|
||||
Reference in New Issue
Block a user