Skip to content
Merged
83 changes: 77 additions & 6 deletions MerlinAU.asp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
<script language="JavaScript" type="text/javascript">

/**----------------------------**/
/** Last Modified: 2025-Apr-09 **/
/** Intended for 1.4.x Release **/
/** Last Modified: 2025-May-10 **/
/**----------------------------**/

// Separate variables for shared and AJAX settings //
Expand Down Expand Up @@ -70,6 +69,7 @@ var defaultFWUpdateZIPdirPath = '/home/root';
var isEMailConfigEnabledInAMTM = false;
var scriptAutoUpdateCronSchedHR = 'TBD';
var fwAutoUpdateCheckCronSchedHR = 'TBD';
var isScriptUpdateAvailable = 'TBD';

const validationErrorMsg = 'Validation failed. Please correct invalid value and try again.';

Expand Down Expand Up @@ -988,6 +988,7 @@ function GetExternalCheckResults()
if (externalCheckOK)
{
fwUpdateDirPath.ResetExtCheckVars();
showScriptUpdateBanner();
return true;
}
let fwUpdateZIPdirectory = document.getElementById('fwUpdateZIPDirectory');
Expand Down Expand Up @@ -1569,6 +1570,7 @@ function InitializeFields()
// fallback to 'DISABLED' if custom_settings.FW_Update_Check is missing //

$('#KeepConfigFile').prop('checked',false);
$('#ForceScriptUpdateCheck').prop('checked',false);
$('#BypassPostponedDays').prop('checked',false);
$('#RunLoginTestOnSave').prop('checked',false);

Expand Down Expand Up @@ -2032,6 +2034,28 @@ function UpdateScriptVersion()
$('#footerTitle').text ('MerlinAU v' + localVers + ' by ExtremeFiretop & Martinski W.');
}

/**---------------------------------------**/
/** Added by ExtremeFiretop [2025-May-10] **/
/**---------------------------------------**/
function showScriptUpdateBanner () {
const localVers = GetScriptVersion('local');
if (typeof isScriptUpdateAvailable === 'undefined') return;

if (isScriptUpdateAvailable && isScriptUpdateAvailable !== localVers) {
const host = document.getElementById('ScriptUpdateNotice');
if (!host) return;

host.innerHTML =
InvREDct +
'Script&nbsp;Update&nbsp;Available&nbsp;&rarr;&nbsp;v' +
isScriptUpdateAvailable +
InvCLEAR;

host.style.cssText =
'float:right;margin-left:auto;font-weight:bold;white-space:nowrap;';
}
}

/**----------------------------------------**/
/** Modified by Martinski W. [2025-Jan-20] **/
/**----------------------------------------**/
Expand Down Expand Up @@ -2260,6 +2284,32 @@ function Uninstall()
document.form.submit();
}

/**---------------------------------------**/
/** Added by ExtremeFiretop [2025-May-10] **/
/**---------------------------------------**/
function UpdateMerlinAUScript ()
{
console.log("Initiating MerlinAU script update…");

let actionScriptValue;
let ForceScriptUpdateCheck = document.getElementById('ForceScriptUpdateCheck');
let ok = confirm(
ForceScriptUpdateCheck.checked
? "INSTALL UPDATE: Install MerlinAU script update immediately. Even if current.\n\nContinue?"
: "VERIFY AND PROMPT: Check for a newer version of MerlinAU and prompt if found. Does NOT install! \n\nContinue?");
if (!ok) return;

if (!ForceScriptUpdateCheck.checked)
{ actionScriptValue = 'start_MerlinAUupdate'; }
else
{ actionScriptValue = 'start_MerlinAUupdate_forceupdate'; }

document.form.action_script.value = actionScriptValue;
document.form.action_wait.value = 10;
showLoading();
document.form.submit();
}

/**----------------------------------------**/
/** Modified by Martinski W. [2025-Jan-22] **/
/**----------------------------------------**/
Expand Down Expand Up @@ -2509,6 +2559,7 @@ function initializeCollapsibleSections()
href="https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/wiki"
title="Go to MerlinAU Wiki page" target="_blank">Wiki</a> ]
</span>
<span id="ScriptUpdateNotice"></span>
</div>
<div style="line-height:10px;">&nbsp;</div>

Expand Down Expand Up @@ -2618,9 +2669,10 @@ function initializeCollapsibleSections()
<div style="text-align: center; margin-top: 3px;">
<table width="100%" border="0" cellpadding="10" cellspacing="0" style="table-layout: fixed; border-collapse: collapse; background-color: transparent;">
<colgroup>
<col style="width: 33%;" />
<col style="width: 33%;" />
<col style="width: 33%;" />
<col style="width: 25%;" />
<col style="width: 25%;" />
<col style="width: 25%;" />
<col style="width: 25%;" />
</colgroup>
<tr>
<td style="text-align: right; border: none;">
Expand All @@ -2638,9 +2690,28 @@ function initializeCollapsibleSections()
<br>
<label style="color:#FFCC00; margin-top: 5px; margin-bottom:8x">
<input type="checkbox" id="approveChangelogCheck" name="approveChangelogCheck" onclick="ToggleChangelogApproval(this);"
style="padding:0; vertical-align:middle; position:relative; margin-left:-5px; margin-top:5px; margin-bottom:8px"/>Approve Changelog</label>
style="padding:0; vertical-align:middle; position:relative; margin-left:-5px; margin-top:5px; margin-bottom:8px"/>Approve changelog</label>
</br>
</td>
<td style="text-align: center; border: none;" id="scriptUpdateCell">
<input type="submit"
id="ScriptUpdateButton"
onclick="UpdateMerlinAUScript(); return false;"
value="Script Update Check"
class="button_gen savebutton"
title="Check for latest MerlinAU script updates"
name="button">
<br>
<label style="color:#FFCC00; margin-top: 5px; margin-bottom:8px">
<input type="checkbox"
id="ForceScriptUpdateCheck"
name="ForceScriptUpdateCheck"
style="padding:0; vertical-align:middle; position:relative;
margin-left:-5px; margin-top:5px; margin-bottom:8px"/>
Install script update
</label>
</br>
</td>
<td style="text-align: left; border: none;">
<input type="submit" id="UninstallButton" onclick="Uninstall(); return false;"
value="Uninstall" class="button_gen savebutton" name="button">
Expand Down
24 changes: 18 additions & 6 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-May-05
# Last Modified: 2025-May-10
###################################################################
set -u

## Set version for each Production Release ##
readonly SCRIPT_VERSION=1.4.4
readonly SCRIPT_VERSION=1.4.5
readonly SCRIPT_NAME="MerlinAU"
## Set to "master" for Production Releases ##
SCRIPT_BRANCH="dev"
Expand Down Expand Up @@ -2947,7 +2947,7 @@ _SCRIPT_UPDATE_()
}

##------------------------------------------##
## Modified by ExtremeFiretop [2025-Apr-14] ##
## Modified by ExtremeFiretop [2025-May-10] ##
##------------------------------------------##
_CheckForNewScriptUpdates_()
{
Expand Down Expand Up @@ -2996,6 +2996,7 @@ _CheckForNewScriptUpdates_()
then
scriptUpdateNotify="New script update available.
${REDct}v${SCRIPT_VERSION}${NOct} --> ${GRNct}v${DLRepoVersion}${NOct}"
_WriteVarDefToHelperJSFile_ "isScriptUpdateAvailable" "$DLRepoVersion"
if [ $# -gt 0 ] && [ "$1" = "-quietcheck" ]
then return 0
fi
Expand Down Expand Up @@ -10950,9 +10951,9 @@ then
_DoExit_ 0
fi

##----------------------------------------##
## Modified by Martinski W. [2025-Feb-15] ##
##----------------------------------------##
##------------------------------------------##
## Modified by ExtremeFiretop [2025-May-10] ##
##------------------------------------------##
if [ $# -gt 0 ]
then
if ! _AcquireLock_ cliOptsLock
Expand Down Expand Up @@ -11061,6 +11062,17 @@ then
_ReleaseLock_ cliFileLock
fi
;;
"${SCRIPT_NAME}update" | \
"${SCRIPT_NAME}update_forceupdate")
if _AcquireLock_ cliFileLock
then
if [ "$3" = "${SCRIPT_NAME}update_forceupdate" ]
then _SCRIPT_UPDATE_ force
else _CheckForNewScriptUpdates_
fi
_ReleaseLock_ cliFileLock
fi
;;
"${SCRIPT_NAME}config" | \
"${SCRIPT_NAME}config_runLoginTest")
if _AcquireLock_ cliFileLock
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.4
## 2025-May-08
## v1.4.5
## 2025-May-?

## WebUI:
![image](https://github.com/user-attachments/assets/a2197262-ca35-451a-8645-311896e1495e)
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.4
1.4.5