diff --git a/MerlinAU.sh b/MerlinAU.sh index 697cc167..eea31ffb 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -4,12 +4,12 @@ # # Original Creation Date: 2023-Oct-01 by @ExtremeFiretop. # Official Co-Author: @Martinski W. - Date: 2023-Nov-01 -# Last Modified: 2025-Mar-30 +# Last Modified: 2025-Apr-07 ################################################################### set -u ## Set version for each Production Release ## -readonly SCRIPT_VERSION=1.4.0 +readonly SCRIPT_VERSION=1.4.1 readonly SCRIPT_NAME="MerlinAU" ## Set to "master" for Production Releases ## SCRIPT_BRANCH="dev" @@ -2151,14 +2151,35 @@ _Mount_WebUI_() return 0 } -##-------------------------------------## -## Added by Martinski W. [2025-Feb-12] ## -##-------------------------------------## +##------------------------------------------## +## Modified by ExtremeFiretop [2025-Apr-07] ## +##------------------------------------------## _CheckFor_WebGUI_Page_() { - if "$mountWebGUI_OK" && \ - [ "$(_Check_WebGUI_Page_Exists_)" = "NONE" ] - then _Mount_WebUI_ ; fi + if "$mountWebGUI_OK" && \ + [ "$(_Check_WebGUI_Page_Exists_)" = "NONE" ] + then + # Only try to download if the local .asp file does NOT exist: + if [ ! -f "$SCRIPT_WEB_ASP_FILE" ] + then + if _CurlFileDownload_ "$SCRIPT_WEB_ASP_FILE" "$SCRIPT_WEB_ASP_PATH" + then + chmod 664 "$SCRIPT_WEB_ASP_PATH" + theWebPage="$(_GetWebUIPage_ "$SCRIPT_WEB_ASP_PATH")" + if [ -n "$theWebPage" ] && [ "$theWebPage" != "NONE" ] + then + sed -i "/url: \"$theWebPage\", tabName: \"$SCRIPT_NAME\"/d" "$TEMP_MENU_TREE" + rm -f "${SHARED_WEB_DIR}/$theWebPage" + rm -f "${SHARED_WEB_DIR}/$(echo "$theWebPage" | cut -f1 -d'.').title" + fi + _Mount_WebUI_ + else + Say "${REDct}**ERROR**${NOct}: Unable to download latest WebUI ASP file for $SCRIPT_NAME." + fi + else + _Mount_WebUI_ + fi + fi } ##----------------------------------------## @@ -9587,13 +9608,12 @@ then _ReleaseLock_ ; exit 0 fi -##---------------------------------------## -## Added by ExtremeFiretop [2025-Feb-08] ## -##---------------------------------------## +##------------------------------------------## +## Modified by ExtremeFiretop [2025-Apr-07] ## +##------------------------------------------## _CheckAndSetBackupOption_() { - local currentBackupOption - currentBackupOption="$(Get_Custom_Setting "FW_Auto_Backupmon")" + local currentBackupOption="$(Get_Custom_Setting "FW_Auto_Backupmon")" if [ -f "/jffs/scripts/backupmon.sh" ] then # If setting is empty, add it to the configuration file # @@ -9661,15 +9681,16 @@ _EnableFWAutoUpdateChecks_() fi } -##----------------------------------------## -## Modified by Martinski W. [2025-Jan-12] ## -##----------------------------------------## +##------------------------------------------## +## Modified by ExtremeFiretop [2025-Apr-07] ## +##------------------------------------------## _ConfirmCronJobForFWAutoUpdates_() { if [ $# -gt 0 ] && [ -n "$1" ] && \ echo "$1" | grep -qE "^(install|startup)$" then return 1 ; fi + FW_UpdateCronJobSchedule="$(Get_Custom_Setting FW_New_Update_Cron_Job_Schedule)" # Check if the PREVIOUS Cron Job ID already exists # if eval $cronListCmd | grep -qE "$CRON_JOB_RUN #${CRON_JOB_TAG_OLD}#$" then #If it exists, delete the OLD one & create a NEW one# @@ -10683,9 +10704,9 @@ _MainMenu_() done } -##-------------------------------------## -## Added by Martinski W. [2025-Jan-15] ## -##-------------------------------------## +##------------------------------------------## +## Modified by ExtremeFiretop [2025-Apr-07] ## +##------------------------------------------## _DoInitializationStartup_() { if ! _CheckForMinimumRequirements_ @@ -10694,6 +10715,9 @@ _DoInitializationStartup_() _DoExit_ 1 fi + _CheckAndSetBackupOption_ + _SetDefaultBuildType_ + if [ $# -gt 0 ] && [ -n "$1" ] && \ echo "$1" | grep -qE "^(install|startup)$" then return 1 ; fi @@ -10709,9 +10733,6 @@ _DoInitializationStartup_() _AutoStartupHook_ create 2>/dev/null _AutoServiceEvent_ create 2>/dev/null fi - - _CheckAndSetBackupOption_ - _SetDefaultBuildType_ } FW_InstalledVersion="$(_GetCurrentFWInstalledLongVersion_)" diff --git a/README.md b/README.md index f300d7d0..e23e13b1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MerlinAU - AsusWRT-Merlin Firmware Auto Updater -## v1.4.0 -## 2025-Apr-06 +## v1.4.1 +## 2025-Apr-07 ## WebUI: ![image](https://github.com/user-attachments/assets/92701007-a902-4724-9bae-b255856a686a) diff --git a/version.txt b/version.txt index 9c0eb14b..93ff4355 100644 --- a/version.txt +++ b/version.txt @@ -1,2 +1,2 @@ -1.4.0 -25040600 +1.4.1 +25040709