Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 43 additions & 22 deletions MerlinAU.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

##----------------------------------------##
Expand Down Expand Up @@ -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 #
Expand Down Expand Up @@ -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#
Expand Down Expand Up @@ -10683,9 +10704,9 @@ _MainMenu_()
done
}

##-------------------------------------##
## Added by Martinski W. [2025-Jan-15] ##
##-------------------------------------##
##------------------------------------------##
## Modified by ExtremeFiretop [2025-Apr-07] ##
##------------------------------------------##
_DoInitializationStartup_()
{
if ! _CheckForMinimumRequirements_
Expand All @@ -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
Expand All @@ -10709,9 +10733,6 @@ _DoInitializationStartup_()
_AutoStartupHook_ create 2>/dev/null
_AutoServiceEvent_ create 2>/dev/null
fi

_CheckAndSetBackupOption_
_SetDefaultBuildType_
}

FW_InstalledVersion="$(_GetCurrentFWInstalledLongVersion_)"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions version.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1.4.0
25040600
1.4.1
25040709