From 7ab1cc2d6ba3048c4281cb8703f05ea3bddf60cd Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 25 Mar 2023 11:28:16 -0500 Subject: [PATCH] Update mm-scripts.sh --- mm-scripts.sh | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/mm-scripts.sh b/mm-scripts.sh index c8c8b9b..c48800a 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -361,8 +361,6 @@ MMSTOP(){ echo -e "${idsCL[Yellow]}The system is already stopped, will verify anyway...${idsCL[Default]}" else echo -e "${idsCL[Green]}Stopping System...${idsCL[Default]}" - echo - fi echo touch ${MMFOLDER}/mm.stop @@ -393,23 +391,6 @@ MMSTOP(){ checked=false fi done - # if ! lsof -Pi :5000 -sTCP:LISTEN -t >/dev/null; then #ombi - # if ! lsof -Pi :5555 -sTCP:LISTEN -t >/dev/null; then #radarr - # if ! lsof -Pi :5556 -sTCP:LISTEN -t >/dev/null; then #radarr3d - # if ! lsof -Pi :5656 -sTCP:LISTEN -t >/dev/null; then #sonarr - # if ! lsof -Pi :5858 -sTCP:LISTEN -t >/dev/null; then #qbittorrent - # if ! lsof -Pi :8181 -sTCP:LISTEN -t >/dev/null; then #tautulli - # if ! lsof -Pi :8686 -sTCP:LISTEN -t >/dev/null; then #lidarr - # if ! lsof -Pi :9117 -sTCP:LISTEN -t >/dev/null; then #jackett - # checked="" - # fi #/jackett - # fi #/lidarr - # fi #/tautulli - # fi #/qbittorrent - # fi #/sonarr - # fi #/radarr3d - # fi #/radarr - # fi #/ombi done echo -e "${idsCL[Green]}Done${idsCL[Default]}" @@ -477,7 +458,11 @@ MMSTATUS(){ echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" else - echo -e "${idsCL[Green]}Running${idsCL[Default]}" + if ([ "${MM_SERVICE_PORTS[${srvc}]}" != "" ] && [ lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t >/dev/null ]) || [ "${MM_SERVICE_PORTS[${srvc}]}" == "" ]; then + echo -e "${idsCL[Green]}Running${idsCL[Default]}" + elif [ ! lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t >/dev/null ] + echo -e "${idsCL[LightMagenta]}Service Running, Web Port Not Accesible${idsCL[Default]}" + fi if [[ ${srvc} == *"vpn"* ]] || [[ ${srvc} == *"wireguard"* ]]; then zerogw=$(/sbin/ip route show | grep 0.0.0.0 | cut -d' ' -f 3)