Skip to content

Commit 7377cd5

Browse files
Merge pull request #443 from ExtremeFiretop/ExtremeFiretop-BugFixes
Bug Fixes for Fresh Installs
2 parents 3fee42e + 0e3e28d commit 7377cd5

File tree

3 files changed

+47
-26
lines changed

3 files changed

+47
-26
lines changed

MerlinAU.sh

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
#
55
# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
66
# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
7-
# Last Modified: 2025-Mar-30
7+
# Last Modified: 2025-Apr-07
88
###################################################################
99
set -u
1010

1111
## Set version for each Production Release ##
12-
readonly SCRIPT_VERSION=1.4.0
12+
readonly SCRIPT_VERSION=1.4.1
1313
readonly SCRIPT_NAME="MerlinAU"
1414
## Set to "master" for Production Releases ##
1515
SCRIPT_BRANCH="dev"
@@ -2151,14 +2151,35 @@ _Mount_WebUI_()
21512151
return 0
21522152
}
21532153

2154-
##-------------------------------------##
2155-
## Added by Martinski W. [2025-Feb-12] ##
2156-
##-------------------------------------##
2154+
##------------------------------------------##
2155+
## Modified by ExtremeFiretop [2025-Apr-07] ##
2156+
##------------------------------------------##
21572157
_CheckFor_WebGUI_Page_()
21582158
{
2159-
if "$mountWebGUI_OK" && \
2160-
[ "$(_Check_WebGUI_Page_Exists_)" = "NONE" ]
2161-
then _Mount_WebUI_ ; fi
2159+
if "$mountWebGUI_OK" && \
2160+
[ "$(_Check_WebGUI_Page_Exists_)" = "NONE" ]
2161+
then
2162+
# Only try to download if the local .asp file does NOT exist:
2163+
if [ ! -f "$SCRIPT_WEB_ASP_FILE" ]
2164+
then
2165+
if _CurlFileDownload_ "$SCRIPT_WEB_ASP_FILE" "$SCRIPT_WEB_ASP_PATH"
2166+
then
2167+
chmod 664 "$SCRIPT_WEB_ASP_PATH"
2168+
theWebPage="$(_GetWebUIPage_ "$SCRIPT_WEB_ASP_PATH")"
2169+
if [ -n "$theWebPage" ] && [ "$theWebPage" != "NONE" ]
2170+
then
2171+
sed -i "/url: \"$theWebPage\", tabName: \"$SCRIPT_NAME\"/d" "$TEMP_MENU_TREE"
2172+
rm -f "${SHARED_WEB_DIR}/$theWebPage"
2173+
rm -f "${SHARED_WEB_DIR}/$(echo "$theWebPage" | cut -f1 -d'.').title"
2174+
fi
2175+
_Mount_WebUI_
2176+
else
2177+
Say "${REDct}**ERROR**${NOct}: Unable to download latest WebUI ASP file for $SCRIPT_NAME."
2178+
fi
2179+
else
2180+
_Mount_WebUI_
2181+
fi
2182+
fi
21622183
}
21632184

21642185
##----------------------------------------##
@@ -9587,13 +9608,12 @@ then
95879608
_ReleaseLock_ ; exit 0
95889609
fi
95899610

9590-
##---------------------------------------##
9591-
## Added by ExtremeFiretop [2025-Feb-08] ##
9592-
##---------------------------------------##
9611+
##------------------------------------------##
9612+
## Modified by ExtremeFiretop [2025-Apr-07] ##
9613+
##------------------------------------------##
95939614
_CheckAndSetBackupOption_()
95949615
{
9595-
local currentBackupOption
9596-
currentBackupOption="$(Get_Custom_Setting "FW_Auto_Backupmon")"
9616+
local currentBackupOption="$(Get_Custom_Setting "FW_Auto_Backupmon")"
95979617
if [ -f "/jffs/scripts/backupmon.sh" ]
95989618
then
95999619
# If setting is empty, add it to the configuration file #
@@ -9661,15 +9681,16 @@ _EnableFWAutoUpdateChecks_()
96619681
fi
96629682
}
96639683

9664-
##----------------------------------------##
9665-
## Modified by Martinski W. [2025-Jan-12] ##
9666-
##----------------------------------------##
9684+
##------------------------------------------##
9685+
## Modified by ExtremeFiretop [2025-Apr-07] ##
9686+
##------------------------------------------##
96679687
_ConfirmCronJobForFWAutoUpdates_()
96689688
{
96699689
if [ $# -gt 0 ] && [ -n "$1" ] && \
96709690
echo "$1" | grep -qE "^(install|startup)$"
96719691
then return 1 ; fi
96729692

9693+
FW_UpdateCronJobSchedule="$(Get_Custom_Setting FW_New_Update_Cron_Job_Schedule)"
96739694
# Check if the PREVIOUS Cron Job ID already exists #
96749695
if eval $cronListCmd | grep -qE "$CRON_JOB_RUN #${CRON_JOB_TAG_OLD}#$"
96759696
then #If it exists, delete the OLD one & create a NEW one#
@@ -10683,9 +10704,9 @@ _MainMenu_()
1068310704
done
1068410705
}
1068510706

10686-
##-------------------------------------##
10687-
## Added by Martinski W. [2025-Jan-15] ##
10688-
##-------------------------------------##
10707+
##------------------------------------------##
10708+
## Modified by ExtremeFiretop [2025-Apr-07] ##
10709+
##------------------------------------------##
1068910710
_DoInitializationStartup_()
1069010711
{
1069110712
if ! _CheckForMinimumRequirements_
@@ -10694,6 +10715,9 @@ _DoInitializationStartup_()
1069410715
_DoExit_ 1
1069510716
fi
1069610717

10718+
_CheckAndSetBackupOption_
10719+
_SetDefaultBuildType_
10720+
1069710721
if [ $# -gt 0 ] && [ -n "$1" ] && \
1069810722
echo "$1" | grep -qE "^(install|startup)$"
1069910723
then return 1 ; fi
@@ -10709,9 +10733,6 @@ _DoInitializationStartup_()
1070910733
_AutoStartupHook_ create 2>/dev/null
1071010734
_AutoServiceEvent_ create 2>/dev/null
1071110735
fi
10712-
10713-
_CheckAndSetBackupOption_
10714-
_SetDefaultBuildType_
1071510736
}
1071610737

1071710738
FW_InstalledVersion="$(_GetCurrentFWInstalledLongVersion_)"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MerlinAU - AsusWRT-Merlin Firmware Auto Updater
2-
## v1.4.0
3-
## 2025-Apr-06
2+
## v1.4.1
3+
## 2025-Apr-07
44

55
## WebUI:
66
![image](https://github.com/user-attachments/assets/92701007-a902-4724-9bae-b255856a686a)

version.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1.4.0
2-
25040600
1+
1.4.1
2+
25040709

0 commit comments

Comments
 (0)