Update mm-scripts.sh
This commit is contained in:
@@ -328,14 +328,10 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
|
|||||||
if [ "${MM_SERVICE_PORTS[${srvc}]}" != "" ]; then
|
if [ "${MM_SERVICE_PORTS[${srvc}]}" != "" ]; then
|
||||||
checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t)
|
checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t)
|
||||||
|
|
||||||
checked=false
|
|
||||||
tryupdate=false
|
tryupdate=false
|
||||||
cc=0
|
cc=0
|
||||||
until [ "${checked}" = "" ]; do
|
until [ "${checkport}" != "" ]; do
|
||||||
if [ "${checkport}" != "" ]; then
|
if [ ${cc} -eq 10 ]; then
|
||||||
checked=""
|
|
||||||
fi
|
|
||||||
if [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then
|
|
||||||
if [ -f ${MMFOLDER}/mm.${srvc}.starting ]; then
|
if [ -f ${MMFOLDER}/mm.${srvc}.starting ]; then
|
||||||
msg="${srvc^} Service is not starting properly, will try and update"
|
msg="${srvc^} Service is not starting properly, will try and update"
|
||||||
echo -e "${idsCL[Red]}${msg}${idsCL[Default]}"
|
echo -e "${idsCL[Red]}${msg}${idsCL[Default]}"
|
||||||
@@ -353,12 +349,14 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
|
|||||||
else
|
else
|
||||||
touch ${MMFOLDER}/mm.${srvc}.starting
|
touch ${MMFOLDER}/mm.${srvc}.starting
|
||||||
fi
|
fi
|
||||||
checked=""
|
checkport="go"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
if [ "${checkport}" != "go" ]; then
|
||||||
|
checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t)
|
||||||
((cc=${cc}+1))
|
((cc=${cc}+1))
|
||||||
sleep 1s
|
sleep 1s
|
||||||
checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t)
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -432,11 +430,11 @@ MMSTOP(){
|
|||||||
checked=false
|
checked=false
|
||||||
until [ "${checked}" = "" ]; do
|
until [ "${checked}" = "" ]; do
|
||||||
for srvc in "${SERVICES_CHECK[@]}"; do
|
for srvc in "${SERVICES_CHECK[@]}"; do
|
||||||
if ! lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t >/dev/null; then
|
checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t)
|
||||||
checked=""
|
until [ "${checkport}" != "" ]; do
|
||||||
else
|
sleep 1s
|
||||||
checked=false
|
checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t)
|
||||||
fi
|
done
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user