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