Update mm-scripts.sh

This commit is contained in:
2023-03-26 20:11:22 -05:00
parent 45c76a6acb
commit b498f8f04a

View File

@@ -326,6 +326,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
if [ "$(systemctl is-active ${srvc})" != "active" ]; then if [ "$(systemctl is-active ${srvc})" != "active" ]; then
/bin/systemctl start ${srvc} /bin/systemctl start ${srvc}
fi fi
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 checked=false
@@ -335,7 +336,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
if [ "${checkport}" != "" ]; then if [ "${checkport}" != "" ]; then
checked="" checked=""
fi fi
if [ "${checked}" == "false" ] && [ ${cc} -eq 15 ]; then if [ "${checked}" == "false" ] && [ ${cc} -eq 3 ]; then
echo -e "${idsCL[Red]}${srvc} Service is not starting properly, will try and update${idsCL[Default]}" echo -e "${idsCL[Red]}${srvc} Service is not starting properly, will try and update${idsCL[Default]}"
echo "$(date) - ${srvc} Service is not starting properly, will try and update" >> $logfile echo "$(date) - ${srvc} Service is not starting properly, will try and update" >> $logfile
SENDNOTICE "${srvc} Service Issue" "${srvc} Service is not starting properly, will try and update" 1 SENDNOTICE "${srvc} Service Issue" "${srvc} Service is not starting properly, will try and update" 1
@@ -356,6 +357,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
if ([ "${checkport}" == "" ] || [ "${tryupdate}" == "true" ]) && [ "${MM_UPDATE_REPO[${srvc}]}" != "" ]; then if ([ "${checkport}" == "" ] || [ "${tryupdate}" == "true" ]) && [ "${MM_UPDATE_REPO[${srvc}]}" != "" ]; then
UPDATESERVICE ${srvc} >/dev/null 2>&1 UPDATESERVICE ${srvc} >/dev/null 2>&1
fi fi
fi
done done
echo -e "${idsCL[Green]}Done${idsCL[Default]}" echo -e "${idsCL[Green]}Done${idsCL[Default]}"