Update mm-scripts.sh

This commit is contained in:
2023-03-26 20:28:20 -05:00
parent 286b6fdca4
commit 1786b20887

View File

@@ -335,18 +335,26 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
if [ "${checkport}" != "" ]; then
checked=""
fi
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"
if [ "${checked}" == "false" ] && [ ${cc} -eq 4 ]; then
if [ -f ${MMFOLDER}/mm.${srvc}.starting ]; 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
tryupdate="true"
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]}"
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]}"
rm -f ${MMFOLDER}/mm.${srvc}.starting
else
touch ${MMFOLDER}/mm.${srvc}.starting
fi
checked=""
fi
((cc=${cc}+1))
sleep 1s