From adeef4ac734d7108eb46b12aa6b536ea1d076621 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 30 Jun 2025 18:48:57 -0500 Subject: [PATCH] update --- defaults.inc | 2 +- inc/services.inc | 11 +++++------ inc/status.inc | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/defaults.inc b/defaults.inc index b2a22c6a..1b6e4a51 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='5.5.32-06292025' +VERS='5.5.33-06302025' NM_BETA=false noheader=' test 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 offsite-staticroute-fix ' diff --git a/inc/services.inc b/inc/services.inc index 2d2cf4f0..d61de6b8 100755 --- a/inc/services.inc +++ b/inc/services.inc @@ -214,11 +214,10 @@ SERVICE_MGMT(){ [ ${QUIET} -eq 0 ] && echo -en "${NM_SRVCOPTS[${SERVICE['action']}]}ing on '$nip'... ${idsCL[Default]}" checkhost=$(CHECK_HOST ${nip}) if [ "${checkhost}" != "false" ]; then - #${NCMD} systemctl ${SERVICE['action']} ${SERVICE['service']} > /dev/null 2>&1 if [ ${QUIET} -eq 0 ]; then if [[ "enable,disable" = *"${SERVICE['action']}"* ]] || [ "${SERVICE['service']}" = "daemon-reload" ]; then echo -e "${idsCL[Green]}Done${idsCL[Default]}" - elif [ "$(${NCMD} systemctl is-active ${SERVICE['service']})" = "active" ]; then + elif [ "$(${NCMD} systemctl is-active ${SERVICE['service']} | tr -d $'\r')" = "active" ]; then echo -e "${idsCL[Green]}Done${idsCL[Default]}" elif [ "${SERVICE['action']}" = "stop" ]; then echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}" @@ -455,14 +454,14 @@ SERVICE_MGMT(){ echo fi if [ ${QUIET} -eq 0 ] && [ "${SERVICE['action']}" != "status" ]; then - echo -e "\n ${NCMD} systemctl is-active ${SERVICE['service']}) = active" + SStatus=$(${NCMD} systemctl is-active ${SERVICE['service']} | tr -d $'\r') if [[ "enable,disable" = *"${SERVICE['action']}"* ]] || [ "${SERVICE['service']}" = "daemon-reload" ]; then echo -e "${idsCL[Green]}Done${idsCL[Default]}" - elif [[ "${srva}" = *".socket"* ]] && [ "$(${NCMD} systemctl is-active ${SERVICE['service']})" = "active" ]; then + elif [[ "${srva}" = *".socket"* ]] && [ "${SStatus}" = "active" ]; then echo -e "${idsCL[Green]}Done (& socket service)${idsCL[Default]}" - elif [[ "${srva}" = *"@pdns"* ]] && [ "$(${NCMD} systemctl is-active ${SERVICE['service']})" = "active" ]; then + elif [[ "${srva}" = *"@pdns"* ]] && [ "${SStatus}" = "active" ]; then echo -e "${idsCL[Green]}Done (& @pdns)${idsCL[Default]}" - elif [ "$(${NCMD} systemctl is-active ${SERVICE['service']})" = "active" ]; then + elif [ "${SStatus}" = "active" ]; then echo -e "${idsCL[Green]}Done${idsCL[Default]}" elif [ "${SERVICE['action']}" = "stop" ]; then echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}" diff --git a/inc/status.inc b/inc/status.inc index 8637e0dc..475c01fa 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -616,7 +616,7 @@ STATUS_NODE(){ srvcs=${NODETYPE}_SERVICES_CHECK[@]; srvcstotest="$(join_by " " ${!srvcs})" if [ "${NODETYPE}" != "OFW" ]; then - [ "${NCMD}" != "" ] && srvctst=(`${NCMD} "systemctl is-active ${srvcstotest}"`) || srvctst=(`systemctl is-active ${srvcstotest}`) + [ "${NCMD}" != "" ] && srvctst=(`${NCMD} "systemctl is-active ${srvcstotest}" | tr -d $'\r'`) || srvctst=(`systemctl is-active ${srvcstotest}`) fi sr=0 @@ -654,9 +654,9 @@ STATUS_NODE(){ if [ "${NODETYPE}" != "OFW" ]; then srvctest=${srvctst[$sr]} if [ "${srvctest}" != "active" ] && [ "${srvc}" == "mysql" ]; then - [ "$(${NCMD} systemctl is-active mariadb)" == "active" ] && mysqlgo=true || mysqlgo=false + [ "$(${NCMD} systemctl is-active mariadb | tr -d $'\r')" == "active" ] && mysqlgo=true || mysqlgo=false elif [ "${srvctest}" != "active" ] && [ "${srvc}" == "mariadb" ]; then - [ "$(${NCMD} systemctl is-active mysql)" == "active" ] && mysqlgo=true || mysqlgo=false + [ "$(${NCMD} systemctl is-active mysql | tr -d $'\r')" == "active" ] && mysqlgo=true || mysqlgo=false elif [ "${srvctest}" == "active" ] && ([ "${srvc}" == "mysql" ] || [ "${srvc}" == "mariadb" ]); then mysqlgo=true fi