This commit is contained in:
2024-09-30 16:50:54 -05:00
parent b2803c203e
commit cd53b9edd3
2 changed files with 29 additions and 27 deletions

View File

@@ -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}))