44#
55# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
66# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
7- # Last Modified: 2026-Jun-23
7+ # Last Modified: 2026-Jul-30
88# ##################################################################
99set -u
1010
1111# # Set version for each Production Release ##
1212readonly SCRIPT_VERSION=1.6.6
13- readonly SCRIPT_VERSTAG=" 26073010 "
13+ readonly SCRIPT_VERSTAG=" 26073018 "
1414readonly SCRIPT_NAME=" MerlinAU"
1515# # Set to "master" for Production Releases ##
1616SCRIPT_BRANCH=" dev"
@@ -8852,24 +8852,48 @@ _Toggle_FW_UpdateCheckSetting_()
88528852}
88538853
88548854# #----------------------------------------##
8855- # # Modified by Martinski W. [2025-Feb-22 ] ##
8855+ # # Modified by Martinski W. [2026-Jul-30 ] ##
88568856# #----------------------------------------##
88578857_RemoveCronJobsFromAddOns_ ()
88588858{
8859- eval $cronListCmd | grep -E " $cronJobsRegEx1 |$cronJobsRegEx2 |$cronJobsRegEx3 |cronJobsRegEx4|$cronJobsRegEx5 |$cronJobsRegEx6 " > " $addonCronJobList "
8859+ eval $cronListCmd | grep -E " $cronJobsRegEx1 |$cronJobsRegEx2 |$cronJobsRegEx3 |$ cronJobsRegEx4 |$cronJobsRegEx5 |$cronJobsRegEx6 " > " $addonCronJobList "
88608860 if [ ! -s " $addonCronJobList " ]
88618861 then
88628862 rm -f " $addonCronJobList "
88638863 Say " Cron jobs from 3rd-party add-ons were not found."
88648864 return 1
88658865 fi
88668866
8867+ _RemoveCronJobWithTimeout_ ()
8868+ {
8869+ local cruProcID cruProcOK=false
8870+ local waitSecsMAX=10 waitSecsCNT=0
8871+
8872+ cru d " $1 " & cruProcID=" $! "
8873+
8874+ while [ " $waitSecsCNT " -lt " $waitSecsMAX " ]
8875+ do
8876+ sleep 1
8877+ waitSecsCNT=" $(( waitSecsCNT + 1 )) "
8878+ if ! kill -EXIT " $cruProcID " 2> /dev/null
8879+ then cruProcOK=true ; break
8880+ fi
8881+ done
8882+
8883+ if kill -EXIT " $cruProcID " 2> /dev/null
8884+ then
8885+ kill -9 " $cruProcID "
8886+ Say " Wait Timeout [$waitSecsMAX secs] for CRU command expired."
8887+ fi
8888+ }
8889+
88678890 local cronJobCount=0 cronJobIDx cronJobCMD
88688891
88698892 while read -r cronJobLINE
88708893 do
88718894 if [ -z " $cronJobLINE " ] || echo " $cronJobLINE " | grep -qE " ^[[:blank:]]*#"
8872- then continue ; fi
8895+ then continue
8896+ fi
88738897 cronJobCount=" $(( cronJobCount + 1 )) "
88748898
88758899 [ " $cronJobCount " -eq 1 ] && \
@@ -8881,7 +8905,7 @@ _RemoveCronJobsFromAddOns_()
88818905
88828906 if [ -n " $cronJobIDx " ]
88838907 then
8884- cru d " $cronJobIDx " ; sleep 1
8908+ _RemoveCronJobWithTimeout_ " $cronJobIDx "
88858909 if eval $cronListCmd | grep -qE " #${cronJobIDx} #$"
88868910 then Say " **ERROR**: Failed to remove cron job [$cronJobIDx ]."
88878911 else Say " Cron job [$cronJobIDx ] was removed successfully."
0 commit comments