update
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
VERS='5.1.13-12122023'
|
||||
VERS='5.1.19-12122023'
|
||||
NM_BETA=false
|
||||
|
||||
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 betacheck '
|
||||
|
||||
@@ -3,7 +3,6 @@ STATUS(){
|
||||
start=$(date +%s)
|
||||
log_start=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
|
||||
if [ "${1}" != "-h" ]; then
|
||||
if [ "${1}" != "" ] && [ "${NM_NODETYPES[${1^^}]}" != "" ]; then
|
||||
ntss=${1^^}
|
||||
ntypesel=(${ntss})
|
||||
@@ -13,27 +12,14 @@ STATUS(){
|
||||
ntypesel=(${NM_NODE_TYPES[@]})
|
||||
[ "${1}" == "sync" ] && STATUS_ACTION=repl || STATUS_ACTION=${1}
|
||||
fi
|
||||
fi
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-site) DEL_SITE=${2};;
|
||||
-ssl) DEL_SSL=${2};;
|
||||
-h)
|
||||
echo -e "Usage: ${idsCL[Yellow]}[nodemgmt or nmg] status {status-check}${idsCL[Default]} {"
|
||||
width=25
|
||||
printf "%-${width}s- %s\n" " {status-check}" "By default will check everything, otherwise specifically specify item to check:"
|
||||
printf "%-${width}s- %s\n" " services" "Will verify status of all node services"
|
||||
printf "%-${width}s- %s\n" " dockers" "Will verify status of all node dockers"
|
||||
printf "%-${width}s- %s\n" " repl" "Will verify status of all node replications"
|
||||
echo -e "}\n"
|
||||
rm -Rf ${STATUSRUN_TMPFOLDER}
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
|
||||
# while [ $# -gt 0 ]; do
|
||||
# case "$1" in
|
||||
# -site) DEL_SITE=${2};;
|
||||
# -ssl) DEL_SSL=${2};;
|
||||
#
|
||||
# esac
|
||||
# shift
|
||||
# done
|
||||
|
||||
PRI_CW=40
|
||||
declare -i cw; declare -i spc1; declare -i c
|
||||
|
||||
@@ -1023,7 +1023,24 @@ GUI(){
|
||||
if [ "${2}" == "freespace" ]; then
|
||||
STATUS freespace ${3}
|
||||
else
|
||||
if [ ! -f ${NM_TMPFOLDER}/.statusclean ] || [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/.statusclean)) -ge 3600 ]; then
|
||||
for oldstatus_check in ${NM_TMPFOLDER}/status-*; do
|
||||
[ -d "${oldstatus_check}" ] && [ $(expr $(date +%s) - $(stat -c %Y ${oldstatus_check})) -ge 1200 ] && rm -Rf ${oldstatus_check}
|
||||
done
|
||||
touch ${NM_TMPFOLDER}/.statusclean
|
||||
fi
|
||||
STATUSRUNS=($(find ${NM_TMPFOLDER}/* -maxdepth 1 -type d -iname "status-*" 2>/dev/null))
|
||||
if [ "${2}" == "-h" ] || [ "${2}" == "-help" ]; then
|
||||
echo -e "Usage: ${idsCL[Yellow]}[nodemgmt or nmg] status {status-check}${idsCL[Default]} {"
|
||||
width=25
|
||||
printf "%-${width}s- %s\n" " {status-check}" "By default will check everything, otherwise specifically specify item to check:"
|
||||
printf "%-${width}s- %s\n" " services" "Will verify status of all node services"
|
||||
printf "%-${width}s- %s\n" " dockers" "Will verify status of all node dockers"
|
||||
printf "%-${width}s- %s\n" " repl" "Will verify status of all node replications"
|
||||
echo -e "}\n"
|
||||
rm -Rf ${STATUSRUN_TMPFOLDER}
|
||||
exit 0
|
||||
else
|
||||
if [ ${#STATUSRUNS[@]} -lt 3 ]; then
|
||||
STATUS_START=$(date +%Y-%m-%d-%H-%M-%S)
|
||||
STATUSRUN_TMPFOLDER="${NM_TMPFOLDER}/status-${STATUS_START}"
|
||||
@@ -1042,13 +1059,6 @@ GUI(){
|
||||
mv ${STATUSRUN_TMPFOLDER}/status-check.running ${NM_LOGFOLDER}/status-check.lastrun
|
||||
rm -Rf ${STATUSRUN_TMPFOLDER}
|
||||
|
||||
if [ ! -f ${NM_TMPFOLDER}/.statusclean ] || [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/.statusclean)) -ge 3600 ]; then
|
||||
for oldstatus_check in ${NM_TMPFOLDER}/status-*; do
|
||||
[ -d "${oldstatus_check}" ] && [ $(expr $(date +%s) - $(stat -c %Y ${oldstatus_check})) -ge 1200 ] && rm -Rf ${oldstatus_check}
|
||||
done
|
||||
touch ${NM_TMPFOLDER}/.statusclean
|
||||
fi
|
||||
|
||||
if [ "${3}" == "email" ]; then
|
||||
echo -e "\n\n" >> ${NM_LOGFOLDER}/status-check.lastrun
|
||||
DOWNLIST report >> ${NM_LOGFOLDER}/status-check.lastrun
|
||||
@@ -1060,15 +1070,6 @@ GUI(){
|
||||
rm -Rf ${STATUSRUN_TMPFOLDER}
|
||||
fi
|
||||
|
||||
else
|
||||
for oldstatus_check in ${NM_TMPFOLDER}/status-*; do
|
||||
[ -d "${oldstatus_check}" ] && [ $(expr $(date +%s) - $(stat -c %Y ${oldstatus_check})) -ge 1200 ] && rm -Rf ${oldstatus_check}
|
||||
done
|
||||
touch ${NM_TMPFOLDER}/.statusclean
|
||||
STATUSRUNS=($(find ${NM_TMPFOLDER}/* -maxdepth 1 -type d -iname "status-*" 2>/dev/null))
|
||||
if [ ${#STATUSRUNS[@]} -lt 3 ]; then
|
||||
${NM_SCRIPT} status ${2} ${3} ${4}
|
||||
exit 0
|
||||
else
|
||||
[ "${MM_ACTION}" != "report" ] && echo -e "${idsCL[LightRed]}Whooooaaaaa there cowboy, we got 3 threads running already.... easy killer!${idsCL[Default]}\n"
|
||||
if [ ! -f ${NM_TMPFOLDER}/.overload ] || [ $(expr $(date +%s) - $(stat -c %Y ${NM_TMPFOLDER}/.overload)) -ge 600 ]; then
|
||||
|
||||
Reference in New Issue
Block a user