Update mm-scripts.sh

This commit is contained in:
2023-03-23 22:03:08 -05:00
parent ff437907bf
commit 659e9b6abf

View File

@@ -325,12 +325,12 @@ MMSTOP(){
echo
touch ${MMFOLDER}/mm.stop
echo -en "${idsCL[LightCyan]}Stopping background MM scripts... ${idsCL[Default]}"
getMMbash=$(pgrep -f '/mm')
for i in $getMMbash; do
/bin/kill $i
done
echo -e "${idsCL[Green]} done${idsCL[Default]}"
# echo -en "${idsCL[LightCyan]}Stopping background MM scripts... ${idsCL[Default]}"
# getMMbash=$(pgrep -f '/mm')
# for i in $getMMbash; do
# /bin/kill $i
# done
# echo -e "${idsCL[Green]} done${idsCL[Default]}"
echo -en "${idsCL[LightCyan]}Stopping Services... ${idsCL[Default]}"
#for srvc in "${SERVICES_CHECK[@]}"; do
@@ -504,12 +504,13 @@ if [ ! -f ${MMFOLDER}/mm.update.stop ]; then
checkstopped=`expr $(date +%s) - $(stat -c %Y ${MMFOLDER}/mm.stop.checking)`
if [ $checkstopped -gt 900 ]; then
rm -f ${MMFOLDER}/mm.stop*
echo "$(date) - Bash script stuck in stop mode after doing a check, will restart" >> $logfile
SENDNOTICE "MM Script Error" "Bash script stuck in check mode, restarting system"
MMSTOP
getStuckMM=$(pgrep -f '/mm')
for i in $getStuckMM; do
/bin/kill $i
done
echo "$(date) - Bash script stuck in stop mode after doing a check" >> $logfile
SENDNOTICE "MM Script Error" "Bash script stuck in check mode"
else
exit 1
fi