Update mm-scripts.sh

This commit is contained in:
2023-03-26 20:23:34 -05:00
parent d820c82d06
commit 286b6fdca4

View File

@@ -323,9 +323,8 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
echo -en "${idsCL[LightCyan]}${msg}${spc} ${idsCL[White]}: ${idsCL[Default]}"
for srvc in "${SERVICES_CHECK[@]}"; do
if [ "$(systemctl is-active ${srvc})" != "active" ]; then
/bin/systemctl start ${srvc}
fi
[ "$(systemctl is-active ${srvc})" != "active" ] && /bin/systemctl start ${srvc}
if [ "${MM_SERVICE_PORTS[${srvc}]}" != "" ]; then
checkport=$(lsof -Pi :${MM_SERVICE_PORTS[${srvc}]} -sTCP:LISTEN -t)
@@ -336,14 +335,15 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
if [ "${checkport}" != "" ]; then
checked=""
fi
if [ "${checked}" == "false" ] && [ ${cc} -eq 6 ]; then
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
SENDNOTICE "${srvc} Service Issue" "${srvc} Service is not starting properly, will try and update" 1
if [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then
msg="${srvc^} Service is not starting properly, will try and update"
echo -e "${idsCL[Red]}${msg}${idsCL[Default]}"
echo "$(date) - ${msg}" >> $logfile
SENDNOTICE "${srvc^} Service Issue" "${msg}" 1
checked=""
tryupdate="true"
msg="Updating ${srvc} Service"
msg="Updating ${srvc^} Service"
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]}"