update
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
VERS='4.15.28-11252023'
|
||||
VERS='4.15.29-11252023'
|
||||
|
||||
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update log '
|
||||
CERT_DAEMON='/snap/bin/certbot'
|
||||
|
||||
@@ -478,7 +478,7 @@ CHECK_DOCKER_SERVICES(){
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
echo -en " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}"
|
||||
uptime=`${NCMD} uptime -p`
|
||||
echo -e "${idsCL[LightCyan]} - ${uptime} ${idsCL[LightYello]}${LH}${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightCyan]} - ${uptime} ${idsCL[LightYellow]}${LH}${idsCL[Default]}"
|
||||
DIVIDER false green
|
||||
fi
|
||||
if [ -f ${NM_TMPFOLDER}/${nip}.down ]; then
|
||||
@@ -531,7 +531,7 @@ CHECK_DOCKER_SERVICES(){
|
||||
fi
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.errtime)
|
||||
echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[Red]} - Node has been down for $(SHOW_TIME ${toterrtime}) ${idsCL[LightYello]}${LH}${idsCL[Default]}"
|
||||
echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[Red]} - Node has been down for $(SHOW_TIME ${toterrtime}) ${idsCL[LightYellow]}${LH}${idsCL[Default]}"
|
||||
fi
|
||||
fi
|
||||
if [ "${ST_ACTION}" != "check" ]; then echo; fi
|
||||
|
||||
@@ -61,7 +61,7 @@ STATUS(){
|
||||
echo -en " ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME} (${lip})${idsST[Reset]}"
|
||||
if ([ "${ST_ACTION}" == "report" ] && [ "${2}" == "email" ]) || [ "${ST_ACTION}" != "report" ]; then
|
||||
uptime=`uptime -p`
|
||||
echo -e "${idsCL[LightCyan]} - ${uptime} ${idsCL[LightYello]}- localhost${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightCyan]} - ${uptime} ${idsCL[LightYellow]}- localhost${idsCL[Default]}"
|
||||
else
|
||||
echo -e "${idsCL[Default]}"
|
||||
fi
|
||||
@@ -186,7 +186,7 @@ STATUS(){
|
||||
uptime=$(${NCMD} uptime -p)
|
||||
|
||||
fi
|
||||
echo -e "${idsCL[LightCyan]} - ${uptime} ${idsCL[LightYello]}${LH}${idsCL[Default]}"
|
||||
echo -e "${idsCL[LightCyan]} - ${uptime} ${idsCL[LightYellow]}${LH}${idsCL[Default]}"
|
||||
else
|
||||
echo -e "${idsCL[Default]}"
|
||||
fi
|
||||
@@ -460,9 +460,9 @@ STATUS(){
|
||||
errtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.down)
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
if [ "${checkhost}" != "false" ]; then
|
||||
echo -e "${idsCL[Red]} - Node SSL has been down for $(SHOW_TIME ${toterrtime}) ${idsCL[LightYello]}${LH}${idsCL[Default]}"
|
||||
echo -e "${idsCL[Red]} - Node SSL has been down for $(SHOW_TIME ${toterrtime}) ${idsCL[LightYellow]}${LH}${idsCL[Default]}"
|
||||
else
|
||||
echo -e "${idsCL[Red]} - Node has been down for $(SHOW_TIME ${toterrtime}) ${idsCL[LightYello]}${LH}${idsCL[Default]}"
|
||||
echo -e "${idsCL[Red]} - Node has been down for $(SHOW_TIME ${toterrtime}) ${idsCL[LightYellow]}${LH}${idsCL[Default]}"
|
||||
fi
|
||||
fi
|
||||
if [ $errtime -gt ${NM_RENOTIFY_TIMEOUT} ]; then
|
||||
@@ -659,7 +659,7 @@ It was down for $(SHOW_TIME ${toterrtime})"
|
||||
else NCMD="ssh root@${nip}"; LH=''
|
||||
fi
|
||||
if [ "${ST_ACTION}" != "check" ]; then
|
||||
echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]} [${nip}]${idsST[Reset]}${idsCL[LightCyan]} ${idsCL[LightYello]}${LH}${idsCL[Default]}"
|
||||
echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]} [${nip}]${idsST[Reset]}${idsCL[LightCyan]} ${idsCL[LightYellow]}${LH}${idsCL[Default]}"
|
||||
DIVIDER false green
|
||||
fi
|
||||
|
||||
|
||||
@@ -352,7 +352,7 @@ NODEUPDATE() {
|
||||
c=0; spca=''; spc1=${cw}-${#NODE}; until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr $c + 1`; done
|
||||
echo -en "Updating ${NODE}${spca}"
|
||||
|
||||
if [ "${nip}" != "100.100.2.1" ] && [ "${nip}" != "10.2.1.1" ]; then
|
||||
if [ "${nip}" != "100.100.2.1" ] && [ "${nip}" != "10.2.1.1" ] && [ ! -f ${NM_TMPFOLDER}/${nip}.down ; then
|
||||
if [ "${2}" != "sync" ]; then
|
||||
echo -en " ~ ${idsCL[LightCyan]}NodeMGMT${idsCL[Default]} : "
|
||||
if ! ${NCMD} command -v nodemgmt > /dev/null; then
|
||||
@@ -583,7 +583,7 @@ RUN_COMMAND(){
|
||||
if [[ ${RUN_NODE_IP} == *"${nip}"* ]]; then NCMD=''; LH='- localhost'
|
||||
else NCMD="ssh root@${nip}"; LH=''
|
||||
fi
|
||||
echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[LightCyan]} ${idsCL[LightYello]}${LH}${idsCL[Default]}"
|
||||
echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[LightCyan]} ${idsCL[LightYellow]}${LH}${idsCL[Default]}"
|
||||
DIVIDER false green
|
||||
#echo "Running command: ${NCMD} ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14}"
|
||||
${NCMD} ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14}
|
||||
@@ -724,6 +724,37 @@ DOWNLIST(){
|
||||
echo
|
||||
}
|
||||
|
||||
SETUPSSH(){
|
||||
echo -e "\n${idsST[Bold]}${idsCL[LightCyan]}Beginning SSH verifiication, you may get prompted for crednetials along the way\n"
|
||||
for NTYPE in "${NM_NODE_TYPES[@]}"; do
|
||||
echo -e "${idsST[Bold]}"; DIVIDER
|
||||
echo -e "${idsCL[Yellow]} ${NM_NODETYPES[$NTYPE]}-Nodes - Verifying SSH Connection${idsCL[Default]}"
|
||||
DIVIDER; echo -e "${idsST[Reset]}"
|
||||
nid=1
|
||||
var=${NTYPE}_HOSTS[@]
|
||||
for nip in "${!var}"; do
|
||||
if [[ ${RUN_NODE_IP} != *"${nip}"* ]]; then
|
||||
echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[Default]}"
|
||||
|
||||
ssh-copy-id root@${nip}
|
||||
|
||||
|
||||
echo
|
||||
nid=`expr $nid + 1`
|
||||
fi
|
||||
done
|
||||
echo
|
||||
done
|
||||
|
||||
for hostid in "${!host_ip[@]}"; do
|
||||
checkhost=$(CHECK_HOST ${host_ip[$hostid]})
|
||||
if [ "${checkhost}" != "false" ]; then
|
||||
echo -e "${idsST[Bold]}${idsCL[LightCyan]} ${host_name[$hostid]} - SSH KEY COPY${idsCL[Default]}${idsST[Reset]}"
|
||||
ssh-copy-id root@${host_ip[$hostid]}
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
GUI(){
|
||||
DISP_HEADER true false
|
||||
|
||||
Reference in New Issue
Block a user