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-Aug-16
88# ##################################################################
99set -u
1010
1111# # Set version for each Production Release ##
12- readonly SCRIPT_VERSION=1.6.5
13- readonly SCRIPT_VERSTAG=" 26062300 "
12+ readonly SCRIPT_VERSION=1.6.6
13+ readonly SCRIPT_VERSTAG=" 26081603 "
1414readonly SCRIPT_NAME=" MerlinAU"
1515# # Set to "master" for Production Releases ##
1616SCRIPT_BRANCH=" master"
@@ -1648,7 +1648,7 @@ Get_Custom_Setting()
16481648}
16491649
16501650# #----------------------------------------##
1651- # # Modified by Martinski W. [2025-Jan-20 ] ##
1651+ # # Modified by Martinski W. [2026-Aug-16 ] ##
16521652# #----------------------------------------##
16531653Update_Custom_Settings ()
16541654{
@@ -1678,7 +1678,8 @@ Update_Custom_Settings()
16781678 then
16791679 if [ " $setting_value " != " $( grep " ^$setting_type " " $CONFIG_FILE " | cut -f2 -d' ' ) " ]
16801680 then
1681- sed -i " s/^$setting_type .*/$setting_type $setting_value /" " $CONFIG_FILE "
1681+ fixedVal=" $( echo " $setting_value " | sed ' s/[\/&]/\\&/g' ) "
1682+ sed -i " s/^${setting_type} .*/$setting_type $fixedVal /" " $CONFIG_FILE "
16821683 fi
16831684 else
16841685 echo " $setting_type $setting_value " >> " $CONFIG_FILE "
@@ -4490,9 +4491,9 @@ _CheckForMinimumModelSupport_()
44904491 " $routerModelCheckFailed " && return 1 || return 0
44914492}
44924493
4493- # #-------------------------------------##
4494- # # Added by Martinski W. [2026-Jan-01 ] ##
4495- # #-------------------------------------##
4494+ # #------------------------------------------ ##
4495+ # # Modified by ExtremeFiretop [2026-Jul-30 ] ##
4496+ # #------------------------------------------ ##
44964497_DoMainRouterLogin_ ()
44974498{
44984499 if [ $# -lt 3 ] || [ -z " $1 " ] || [ -z " $2 " ] || [ -z " $3 " ]
@@ -4511,7 +4512,8 @@ _DoMainRouterLogin_()
45114512 -H ' Content-Type: application/x-www-form-urlencoded' \
45124513 -H " Origin: ${routerURL} /" \
45134514 -H ' Connection: keep-alive' \
4514- --data-raw " group_id=&action_mode=&action_script=&action_wait=5¤t_page=Main_Login.asp&next_page=index.asp&login_authorization=$credsENC " \
4515+ --data-raw " group_id=&action_mode=&action_script=&action_wait=5¤t_page=Main_Login.asp&next_page=index.asp" \
4516+ --data-urlencode " login_authorization=$credsENC " \
45154517 --cookie-jar " $cookieFile " ) "
45164518 curlCode=" $? "
45174519
@@ -5381,7 +5383,8 @@ _DoMeshNodeLogin_()
53815383 -H ' Content-Type: application/x-www-form-urlencoded' \
53825384 -H " Origin: ${nodeURL} " \
53835385 -H ' Connection: keep-alive' \
5384- --data-raw " group_id=&action_mode=&action_script=&action_wait=5¤t_page=Main_Login.asp&next_page=index.asp&login_authorization=$credsENC " \
5386+ --data-raw " group_id=&action_mode=&action_script=&action_wait=5¤t_page=Main_Login.asp&next_page=index.asp" \
5387+ --data-urlencode " login_authorization=$credsENC " \
53855388 --cookie-jar " $cookieFile " \
53865389 --max-time 3 > /dev/null 2>&1
53875390
@@ -8850,24 +8853,48 @@ _Toggle_FW_UpdateCheckSetting_()
88508853}
88518854
88528855# #----------------------------------------##
8853- # # Modified by Martinski W. [2025-Feb-22 ] ##
8856+ # # Modified by Martinski W. [2026-Jul-30 ] ##
88548857# #----------------------------------------##
88558858_RemoveCronJobsFromAddOns_ ()
88568859{
8857- eval $cronListCmd | grep -E " $cronJobsRegEx1 |$cronJobsRegEx2 |$cronJobsRegEx3 |cronJobsRegEx4|$cronJobsRegEx5 |$cronJobsRegEx6 " > " $addonCronJobList "
8860+ eval $cronListCmd | grep -E " $cronJobsRegEx1 |$cronJobsRegEx2 |$cronJobsRegEx3 |$ cronJobsRegEx4 |$cronJobsRegEx5 |$cronJobsRegEx6 " > " $addonCronJobList "
88588861 if [ ! -s " $addonCronJobList " ]
88598862 then
88608863 rm -f " $addonCronJobList "
88618864 Say " Cron jobs from 3rd-party add-ons were not found."
88628865 return 1
88638866 fi
88648867
8868+ _RemoveCronJobWithTimeout_ ()
8869+ {
8870+ local cruProcID cruProcOK=false
8871+ local waitSecsMAX=10 waitSecsCNT=0
8872+
8873+ cru d " $1 " & cruProcID=" $! "
8874+
8875+ while [ " $waitSecsCNT " -lt " $waitSecsMAX " ]
8876+ do
8877+ sleep 1
8878+ waitSecsCNT=" $(( waitSecsCNT + 1 )) "
8879+ if ! kill -EXIT " $cruProcID " 2> /dev/null
8880+ then cruProcOK=true ; break
8881+ fi
8882+ done
8883+
8884+ if kill -EXIT " $cruProcID " 2> /dev/null
8885+ then
8886+ kill -9 " $cruProcID "
8887+ Say " Wait Timeout [$waitSecsMAX secs] for CRU command expired."
8888+ fi
8889+ }
8890+
88658891 local cronJobCount=0 cronJobIDx cronJobCMD
88668892
88678893 while read -r cronJobLINE
88688894 do
88698895 if [ -z " $cronJobLINE " ] || echo " $cronJobLINE " | grep -qE " ^[[:blank:]]*#"
8870- then continue ; fi
8896+ then continue
8897+ fi
88718898 cronJobCount=" $(( cronJobCount + 1 )) "
88728899
88738900 [ " $cronJobCount " -eq 1 ] && \
@@ -8879,7 +8906,7 @@ _RemoveCronJobsFromAddOns_()
88798906
88808907 if [ -n " $cronJobIDx " ]
88818908 then
8882- cru d " $cronJobIDx " ; sleep 1
8909+ _RemoveCronJobWithTimeout_ " $cronJobIDx "
88838910 if eval $cronListCmd | grep -qE " #${cronJobIDx} #$"
88848911 then Say " **ERROR**: Failed to remove cron job [$cronJobIDx ]."
88858912 else Say " Cron job [$cronJobIDx ] was removed successfully."
0 commit comments