Skip to content

Commit 58279fa

Browse files
Bug Fixes for Fresh Installs
Bug Fixes for Fresh Installs
1 parent 3fee42e commit 58279fa

File tree

1 file changed

+47
-22
lines changed

1 file changed

+47
-22
lines changed

MerlinAU.sh

Lines changed: 47 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,39 @@ _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+
updatedWebUIPage=false
2163+
# Only try to download if the local .asp file does NOT exist:
2164+
if [ ! -f "$SCRIPT_WEB_ASP_FILE" ]
2165+
then
2166+
if _CurlFileDownload_ "$SCRIPT_WEB_ASP_FILE" "$SCRIPT_WEB_ASP_PATH"
2167+
then
2168+
chmod 664 "$SCRIPT_WEB_ASP_PATH"
2169+
if "$updatedWebUIPage"
2170+
then
2171+
theWebPage="$(_GetWebUIPage_ "$SCRIPT_WEB_ASP_PATH")"
2172+
if [ -n "$theWebPage" ] && [ "$theWebPage" != "NONE" ]
2173+
then
2174+
sed -i "/url: \"$theWebPage\", tabName: \"$SCRIPT_NAME\"/d" "$TEMP_MENU_TREE"
2175+
rm -f "${SHARED_WEB_DIR}/$theWebPage"
2176+
rm -f "${SHARED_WEB_DIR}/$(echo "$theWebPage" | cut -f1 -d'.').title"
2177+
fi
2178+
_Mount_WebUI_
2179+
fi
2180+
else
2181+
Say "${REDct}**ERROR**${NOct}: Unable to download latest WebUI ASP file for $SCRIPT_NAME."
2182+
fi
2183+
else
2184+
_Mount_WebUI_
2185+
fi
2186+
fi
21622187
}
21632188

21642189
##----------------------------------------##
@@ -9587,13 +9612,12 @@ then
95879612
_ReleaseLock_ ; exit 0
95889613
fi
95899614

9590-
##---------------------------------------##
9591-
## Added by ExtremeFiretop [2025-Feb-08] ##
9592-
##---------------------------------------##
9615+
##------------------------------------------##
9616+
## Modified by ExtremeFiretop [2025-Apr-07] ##
9617+
##------------------------------------------##
95939618
_CheckAndSetBackupOption_()
95949619
{
9595-
local currentBackupOption
9596-
currentBackupOption="$(Get_Custom_Setting "FW_Auto_Backupmon")"
9620+
local currentBackupOption="$(Get_Custom_Setting "FW_Auto_Backupmon")"
95979621
if [ -f "/jffs/scripts/backupmon.sh" ]
95989622
then
95999623
# If setting is empty, add it to the configuration file #
@@ -9661,15 +9685,16 @@ _EnableFWAutoUpdateChecks_()
96619685
fi
96629686
}
96639687

9664-
##----------------------------------------##
9665-
## Modified by Martinski W. [2025-Jan-12] ##
9666-
##----------------------------------------##
9688+
##------------------------------------------##
9689+
## Modified by ExtremeFiretop [2025-Apr-07] ##
9690+
##------------------------------------------##
96679691
_ConfirmCronJobForFWAutoUpdates_()
96689692
{
96699693
if [ $# -gt 0 ] && [ -n "$1" ] && \
96709694
echo "$1" | grep -qE "^(install|startup)$"
96719695
then return 1 ; fi
96729696

9697+
FW_UpdateCronJobSchedule="$(Get_Custom_Setting FW_New_Update_Cron_Job_Schedule)"
96739698
# Check if the PREVIOUS Cron Job ID already exists #
96749699
if eval $cronListCmd | grep -qE "$CRON_JOB_RUN #${CRON_JOB_TAG_OLD}#$"
96759700
then #If it exists, delete the OLD one & create a NEW one#
@@ -10683,9 +10708,9 @@ _MainMenu_()
1068310708
done
1068410709
}
1068510710

10686-
##-------------------------------------##
10687-
## Added by Martinski W. [2025-Jan-15] ##
10688-
##-------------------------------------##
10711+
##------------------------------------------##
10712+
## Modified by ExtremeFiretop [2025-Apr-07] ##
10713+
##------------------------------------------##
1068910714
_DoInitializationStartup_()
1069010715
{
1069110716
if ! _CheckForMinimumRequirements_
@@ -10694,6 +10719,9 @@ _DoInitializationStartup_()
1069410719
_DoExit_ 1
1069510720
fi
1069610721

10722+
_CheckAndSetBackupOption_
10723+
_SetDefaultBuildType_
10724+
1069710725
if [ $# -gt 0 ] && [ -n "$1" ] && \
1069810726
echo "$1" | grep -qE "^(install|startup)$"
1069910727
then return 1 ; fi
@@ -10709,9 +10737,6 @@ _DoInitializationStartup_()
1070910737
_AutoStartupHook_ create 2>/dev/null
1071010738
_AutoServiceEvent_ create 2>/dev/null
1071110739
fi
10712-
10713-
_CheckAndSetBackupOption_
10714-
_SetDefaultBuildType_
1071510740
}
1071610741

1071710742
FW_InstalledVersion="$(_GetCurrentFWInstalledLongVersion_)"

0 commit comments

Comments
 (0)