Update status.inc
This commit is contained in:
@@ -174,7 +174,7 @@ STATUS(){
|
|||||||
if [ "${ST_ACTION}" != "dockers" ]; then
|
if [ "${ST_ACTION}" != "dockers" ]; then
|
||||||
srvcs=${NTYPE}_SERVICES_CHECK[@];
|
srvcs=${NTYPE}_SERVICES_CHECK[@];
|
||||||
srvcstotest="$(join_by " " ${!srvcs})"
|
srvcstotest="$(join_by " " ${!srvcs})"
|
||||||
srvctst=(`${NCMD} "systemctl is-active ${srvcstotest}"`)
|
[ "${NTYPE}" != "OFW" ] && srvctst=(`${NCMD} "systemctl is-active ${srvcstotest}"`)
|
||||||
sr=0
|
sr=0
|
||||||
for srvc in "${!srvcs}"; do
|
for srvc in "${!srvcs}"; do
|
||||||
[ "${srvc}" == "gitea" ] && [ "${NTYPE}" == "WEB" ] && [[ $($NCMD /sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *${NM_SINGLESRVR_IP['WEB']}* ]] && NOGOCHK=false || NOGOCHK=true
|
[ "${srvc}" == "gitea" ] && [ "${NTYPE}" == "WEB" ] && [[ $($NCMD /sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *${NM_SINGLESRVR_IP['WEB']}* ]] && NOGOCHK=false || NOGOCHK=true
|
||||||
@@ -189,15 +189,23 @@ STATUS(){
|
|||||||
fi
|
fi
|
||||||
echo -en " ${NM_SERVICE_DESC[${srvc}]}${spc}: "
|
echo -en " ${NM_SERVICE_DESC[${srvc}]}${spc}: "
|
||||||
fi
|
fi
|
||||||
if [ "${srvctst[$sr]}" != "active" ] && [ "${srvc}" == "mysql" ]; then
|
if [ "${NTYPE}" != "OFW" ]; then
|
||||||
[ "$(${NCMD} systemctl is-active mariadb)" == "active" ] && mysqlgo=true || mysqlgo=false
|
srvctest=${srvctst[$sr]}
|
||||||
elif [ "${srvctst[$sr]}" != "active" ] && [ "${srvc}" = "mariadb" ]; then
|
if [ "${srvctest}" != "active" ] && [ "${srvc}" == "mysql" ]; then
|
||||||
[ "$(${NCMD} systemctl is-active mysql)" == "active" ] && mysqlgo=true || mysqlgo=false
|
[ "$(${NCMD} systemctl is-active mariadb)" == "active" ] && mysqlgo=true || mysqlgo=false
|
||||||
elif [ "${srvctst[$sr]}" == "active" ] && ([ "${srvc}" == "mysql" ] || [ "${srvc}" == "mariadb" ]); then
|
elif [ "${srvctest}" != "active" ] && [ "${srvc}" = "mariadb" ]; then
|
||||||
mysqlgo=true
|
[ "$(${NCMD} systemctl is-active mysql)" == "active" ] && mysqlgo=true || mysqlgo=false
|
||||||
|
elif [ "${srvctest}" == "active" ] && ([ "${srvc}" == "mysql" ] || [ "${srvc}" == "mariadb" ]); then
|
||||||
|
mysqlgo=true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ "$(ssh root@${nip} ps -U root | grep "offsite-power-check.sh start" | grep -v "grep" | awk '{print $1}')" != "" ]; then
|
||||||
|
srvctest=active
|
||||||
|
else
|
||||||
|
srvctest=notactive
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
# echo "mysqlgo=${mysqlgo}"
|
if [ "${srvctest}" != "active" ] && [ "${mysqlgo}" != "true" ]; then
|
||||||
if [ "${srvctst[$sr]}" != "active" ] && [ "${mysqlgo}" != "true" ]; then
|
|
||||||
if [ ! -f ${NM_TMPFOLDER}/${nip}~${srvc}.down ]; then
|
if [ ! -f ${NM_TMPFOLDER}/${nip}~${srvc}.down ]; then
|
||||||
[ "${ST_ACTION}" != "check" ] && echo -e "${idsCL[Red]}Not Running${idsCL[Default]}"
|
[ "${ST_ACTION}" != "check" ] && echo -e "${idsCL[Red]}Not Running${idsCL[Default]}"
|
||||||
touch ${NM_TMPFOLDER}/${nip}~${srvc}.down
|
touch ${NM_TMPFOLDER}/${nip}~${srvc}.down
|
||||||
|
|||||||
Reference in New Issue
Block a user