diff --git a/defaults.inc b/defaults.inc index 27a960c..0884a19 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='3.9.73-07142024' +VERS='3.9.80-09302024' MMFOLDER="/opt/idssys/mediamanager" TMPFOLDER="${MMFOLDER}/.tmp" diff --git a/mm-scripts.sh b/mm-scripts.sh index 03b0920..5e28b05 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -522,34 +522,36 @@ MMSTOP(){ # done # echo -e "${idsCL[Green]}Done${idsCL[Default]}" - msg="Stopping Services" - c=0; spc=''; spc1=$((${cw_spc}-${#msg})) - until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done - echo -en "${idsCL[LightCyan]}${msg}${spc} ${idsCL[White]}: ${idsCL[Default]}" - for srvc in "${!MM_SERVICES[@]}"; do - if [[ ${srvc} != *"qbittorrent"* ]] && [[ ${srvc} != *"vpn"* ]] && [[ ${srvc} != *"wireguard"* ]]; then - /bin/systemctl stop ${srvc} >/dev/null 2>&1 & - fi - done - sleep 2s - /bin/systemctl stop qbittorrent - echo -e "${idsCL[Green]}Done${idsCL[Default]}" + if [ "${SERVICESCHECK}" != "" ]; then + msg="Stopping Services" + c=0; spc=''; spc1=$((${cw_spc}-${#msg})) + until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done + echo -en "${idsCL[LightCyan]}${msg}${spc} ${idsCL[White]}: ${idsCL[Default]}" + for srvc in "${!MM_SERVICES[@]}"; do + if [[ ${srvc} != *"qbittorrent"* ]] && [[ ${srvc} != *"vpn"* ]] && [[ ${srvc} != *"wireguard"* ]]; then + /bin/systemctl stop ${srvc} >/dev/null 2>&1 & + fi + done + sleep 2s + /bin/systemctl stop qbittorrent + echo -e "${idsCL[Green]}Done${idsCL[Default]}" - msg="Waiting for Services to stop" - c=0; spc=''; spc1=$((${cw_spc}-${#msg})) - until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done - echo -en "${idsCL[LightCyan]}${msg}${spc} ${idsCL[White]}: ${idsCL[Default]}" - for srvc in "${!MM_SERVICES[@]}"; do - if [ "MM_SERVICE_PORTS[${srvc}]" != "" ] && [[ ${srvc} != *"vpn"* ]] && [[ ${srvc} != *"wireguard"* ]]; then - checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t) - # echo "$srvc - ${MM_SERVICE_PORTS[${srvc}]} - $checkport" - until [ "${checkport}" == "" ]; do - sleep 1s + msg="Waiting for Services to stop" + c=0; spc=''; spc1=$((${cw_spc}-${#msg})) + until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done + echo -en "${idsCL[LightCyan]}${msg}${spc} ${idsCL[White]}: ${idsCL[Default]}" + for srvc in "${!MM_SERVICES[@]}"; do + if [ "MM_SERVICE_PORTS[${srvc}]" != "" ] && [[ ${srvc} != *"vpn"* ]] && [[ ${srvc} != *"wireguard"* ]]; then checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t) - done - fi - done - echo -e "${idsCL[Green]}Done${idsCL[Default]}" + # echo "$srvc - ${MM_SERVICE_PORTS[${srvc}]} - $checkport" + until [ "${checkport}" == "" ]; do + sleep 1s + checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t) + done + fi + done + echo -e "${idsCL[Green]}Done${idsCL[Default]}" + fi msg="Shutting Down VPN Tunnel" c=0; spc=''; spc1=$((${cw_spc}-${#msg}))