From a7ad6819bdf80b470bcd48b699cda4319649c185 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 25 Mar 2023 11:42:58 -0500 Subject: [PATCH] Update mm-scripts.sh --- mm-scripts.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mm-scripts.sh b/mm-scripts.sh index cc3eeb4..454eb74 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -323,7 +323,14 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf echo -en "${idsCL[LightCyan]}${msg}${spc} ${idsCL[White]}: ${idsCL[Default]}" for srvc in "${SERVICES_CHECK[@]}"; do - /bin/systemctl start ${srvc} + if [ "$(systemctl is-active ${srvc})" != "active" ]; then + /bin/systemctl start ${srvc} + sleep 5s + fi + checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t) + if [ "${checkport}" == "" ] && [ -f /opt/${srvc}-update.sh ]; then + /opt/${srvc}-update.sh + fi done echo -e "${idsCL[Green]}Done${idsCL[Default]}"