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
94 changes: 85 additions & 9 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-11 **/
/**----------------------------**/

// 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,36 @@ function UpdateScriptVersion()
$('#footerTitle').text ('MerlinAU v' + localVers + ' by ExtremeFiretop & Martinski W.');
}

/**----------------------------------------**/
/** Modified by Martinski W. [2025-May-11] **/
/**----------------------------------------**/
function ShowScriptUpdateBanner()
{
const localVers = GetScriptVersion('local');
const updateNotice = document.getElementById('ScriptUpdateNotice');

if (updateNotice === null ||
typeof updateNotice === 'undefined' ||
typeof isScriptUpdateAvailable === 'undefined')
{ return; }

if (isScriptUpdateAvailable !== 'TBD' &&
isScriptUpdateAvailable !== localVers)
{
updateNotice.innerHTML =
InvREDct +
'Script Update Available &rarr; v' + isScriptUpdateAvailable +
InvCLEAR;

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

showhide('ScriptUpdateNotice',true);
}
else
{ showhide('ScriptUpdateNotice',false); }
}

/**----------------------------------------**/
/** Modified by Martinski W. [2025-Jan-20] **/
/**----------------------------------------**/
Expand Down Expand Up @@ -2261,7 +2293,34 @@ function Uninstall()
}

/**----------------------------------------**/
/** Modified by Martinski W. [2025-Jan-22] **/
/** Modified by Martinski W. [2025-May-11] **/
/**----------------------------------------**/
function UpdateMerlinAUScript()
{
console.log("Initiating MerlinAU script update…");

let actionScriptValue;
let forceScriptUpdateCheck = document.getElementById('ForceScriptUpdateCheck');

let confirmOK = confirm(
forceScriptUpdateCheck.checked
? "INSTALL UPDATE:\nInstall the latest available MerlinAU script update now, even if version is current.\n\nContinue?"
: "CHECK AND PROMPT:\nCheck for a newer version of MerlinAU and prompt if found. It does NOT install update automatically!\n\nContinue?");
if (!confirmOK) { return; }

if (!forceScriptUpdateCheck.checked)
{ actionScriptValue = 'start_MerlinAUscrptupdate'; }
else
{ actionScriptValue = 'start_MerlinAUscrptupdate_force'; }

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

/**----------------------------------------**/
/** Modified by Martinski W. [2025-May-11] **/
/**----------------------------------------**/
function CheckFirmwareUpdate()
{
Expand All @@ -2271,13 +2330,13 @@ function CheckFirmwareUpdate()
let bypassPostponedDays = document.getElementById('BypassPostponedDays');
if (!bypassPostponedDays.checked)
{
actionScriptValue = 'start_MerlinAUcheckupdate';
actionScriptValue = 'start_MerlinAUcheckfwupdate';
if (!confirm("NOTE:\nIf you have no postponement days set or remaining, the firmware may flash NOW!\nThis means logging you out of the WebUI and rebooting the router.\nContinue to check for firmware updates now?"))
{ return; }
}
else
{
actionScriptValue = 'start_MerlinAUcheckupdate_bypassDays';
actionScriptValue = 'start_MerlinAUcheckfwupdate_bypassDays';
if (!confirm("NOTE:\nThe firmware may flash NOW!\nThis means logging you out of the WebUI and rebooting the router.\nContinue to check for firmware updates now?"))
{ return; }
}
Expand Down Expand Up @@ -2509,6 +2568,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 +2678,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 +2699,24 @@ 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
29 changes: 21 additions & 8 deletions MerlinAU.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#
# 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-11
###################################################################
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="master"
SCRIPT_BRANCH="dev"

##----------------------------------------##
## Modified by Martinski W. [2024-Jul-03] ##
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 All @@ -3006,6 +3007,7 @@ ${REDct}v${SCRIPT_VERSION}${NOct} --> ${GRNct}v${DLRepoVersion}${NOct}"
fi
else
scriptUpdateNotify=0
_WriteVarDefToHelperJSFile_ "isScriptUpdateAvailable" "TBD"
fi
return 0
}
Expand Down Expand Up @@ -10951,7 +10953,7 @@ then
fi

##----------------------------------------##
## Modified by Martinski W. [2025-Feb-15] ##
## Modified by Martinski W. [2025-May-11] ##
##----------------------------------------##
if [ $# -gt 0 ]
then
Expand Down Expand Up @@ -11049,18 +11051,29 @@ then
Update_Custom_Settings "FW_New_Update_Changelog_Approval" "APPROVED"
fi
;;
"${SCRIPT_NAME}checkupdate" | \
"${SCRIPT_NAME}checkupdate_bypassDays")
"${SCRIPT_NAME}checkfwupdate" | \
"${SCRIPT_NAME}checkfwupdate_bypassDays")
if _AcquireLock_ cliFileLock
then
if [ "$3" = "${SCRIPT_NAME}checkupdate_bypassDays" ]
if [ "$3" = "${SCRIPT_NAME}checkfwupdate_bypassDays" ]
then bypassPostponedDays=true
else bypassPostponedDays=false
fi
_RunFirmwareUpdateNow_
_ReleaseLock_ cliFileLock
fi
;;
"${SCRIPT_NAME}scrptupdate" | \
"${SCRIPT_NAME}scrptupdate_force")
if _AcquireLock_ cliFileLock
then
if [ "$3" = "${SCRIPT_NAME}scrptupdate_force" ]
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-15

## 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