diff --git a/MerlinAU.sh b/MerlinAU.sh index 59899d2a..4b377faa 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -4,13 +4,13 @@ # # Original Creation Date: 2023-Oct-01 by @ExtremeFiretop. # Official Co-Author: @Martinski W. - Date: 2023-Nov-01 -# Last Modified: 2026-Jun-23 +# Last Modified: 2026-Jul-30 ################################################################### set -u ## Set version for each Production Release ## readonly SCRIPT_VERSION=1.6.6 -readonly SCRIPT_VERSTAG="26073010" +readonly SCRIPT_VERSTAG="26073018" readonly SCRIPT_NAME="MerlinAU" ## Set to "master" for Production Releases ## SCRIPT_BRANCH="dev" @@ -8852,11 +8852,11 @@ _Toggle_FW_UpdateCheckSetting_() } ##----------------------------------------## -## Modified by Martinski W. [2025-Feb-22] ## +## Modified by Martinski W. [2026-Jul-30] ## ##----------------------------------------## _RemoveCronJobsFromAddOns_() { - eval $cronListCmd | grep -E "$cronJobsRegEx1|$cronJobsRegEx2|$cronJobsRegEx3|cronJobsRegEx4|$cronJobsRegEx5|$cronJobsRegEx6" > "$addonCronJobList" + eval $cronListCmd | grep -E "$cronJobsRegEx1|$cronJobsRegEx2|$cronJobsRegEx3|$cronJobsRegEx4|$cronJobsRegEx5|$cronJobsRegEx6" > "$addonCronJobList" if [ ! -s "$addonCronJobList" ] then rm -f "$addonCronJobList" @@ -8864,12 +8864,36 @@ _RemoveCronJobsFromAddOns_() return 1 fi + _RemoveCronJobWithTimeout_() + { + local cruProcID cruProcOK=false + local waitSecsMAX=10 waitSecsCNT=0 + + cru d "$1" & cruProcID="$!" + + while [ "$waitSecsCNT" -lt "$waitSecsMAX" ] + do + sleep 1 + waitSecsCNT="$((waitSecsCNT + 1))" + if ! kill -EXIT "$cruProcID" 2>/dev/null + then cruProcOK=true ; break + fi + done + + if kill -EXIT "$cruProcID" 2>/dev/null + then + kill -9 "$cruProcID" + Say "Wait Timeout [$waitSecsMAX secs] for CRU command expired." + fi + } + local cronJobCount=0 cronJobIDx cronJobCMD while read -r cronJobLINE do if [ -z "$cronJobLINE" ] || echo "$cronJobLINE" | grep -qE "^[[:blank:]]*#" - then continue ; fi + then continue + fi cronJobCount="$((cronJobCount + 1))" [ "$cronJobCount" -eq 1 ] && \ @@ -8881,7 +8905,7 @@ _RemoveCronJobsFromAddOns_() if [ -n "$cronJobIDx" ] then - cru d "$cronJobIDx" ; sleep 1 + _RemoveCronJobWithTimeout_ "$cronJobIDx" if eval $cronListCmd | grep -qE "#${cronJobIDx}#$" then Say "**ERROR**: Failed to remove cron job [$cronJobIDx]." else Say "Cron job [$cronJobIDx] was removed successfully." diff --git a/README.md b/README.md index 85e405bf..69b0cc4c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # MerlinAU - AsusWRT-Merlin Firmware Auto Updater -## v1.6.5 -## 2026-June-23 +## v1.6.6 +## 2026-Jul-30 ## WebUI: image diff --git a/version.txt b/version.txt index 9f05f9f2..ec70f755 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.6.5 +1.6.6