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
32 changes: 24 additions & 8 deletions MerlinAU.asp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<script language="JavaScript" type="text/javascript">

/**----------------------------**/
/** Last Modified: 2025-Feb-21 **/
/** Last Modified: 2025-Feb-22 **/
/** Intended for 1.4.0 Release **/
/**----------------------------**/

Expand Down Expand Up @@ -1062,6 +1062,8 @@ const emailNotifyHint = 'The Email Notifications option requires the AMTM email

const autoBackupsHint = 'The Automatic Backups option requires the BACKUPMON script to be installed on the router.';

const addonAutoUpdatesHint = 'The daily schedule for automatic updates of MerlinAU is always configured to be 15 minutes *before* the scheduled time for automatic F/W Update checks.';

const ROG_BuildTypeMsg = 'The ROG build type preference will apply only if a compatible ROG firmware image is available. Otherwise, the Pure Non-ROG build will be used instead.';

const TUF_BuildTypeMsg = 'The TUF build type preference will apply only if a compatible TUF firmware image is available. Otherwise, the Pure Non-TUF build will be used instead.';
Expand Down Expand Up @@ -1091,6 +1093,9 @@ function ShowHintMsg (formField)
case 'AUTOMATIC_BACKUPS':
theHintMsg = autoBackupsHint;
break;
case 'ADDON_AUTO_UPDATES':
theHintMsg = addonAutoUpdatesHint;
break;
case 'EMAIL_NOTIFICATION':
theHintMsg = emailNotifyHint;
break;
Expand Down Expand Up @@ -1799,22 +1804,22 @@ function SaveAdvancedConfig()
if (fwUpdateDirectory)
{ advanced_settings.FW_New_Update_ZIP_Directory_Path = fwUpdateDirectory.value || '/tmp/mnt/USB1'; }

// 3) Tailscale/ZeroTier VPN Access - only if not disabled
// 3) Tailscale/ZeroTier VPN Access - only if not disabled //
let tailscaleVPNEnabled = document.getElementById('tailscaleVPNEnabled');
if (tailscaleVPNEnabled && !tailscaleVPNEnabled.disabled)
{ advanced_settings.Allow_Updates_OverVPN = tailscaleVPNEnabled.checked ? 'ENABLED' : 'DISABLED'; }

// 4) Auto-Updates for Script - only if not disabled
// 4) Automatic Updates for Script - only if not disabled //
let script_AutoUpdate_Check = document.getElementById('Script_AutoUpdate_Check');
if (script_AutoUpdate_Check && !script_AutoUpdate_Check.disabled)
{ advanced_settings.Allow_Script_Auto_Update = script_AutoUpdate_Check.checked ? 'ENABLED' : 'DISABLED'; }

// 5) Beta-to-Release Updates - only if not disabled
// 5) Beta-to-Release Updates - only if not disabled //
let betaToReleaseUpdatesEnabled = document.getElementById('betaToReleaseUpdatesEnabled');
if (betaToReleaseUpdatesEnabled && !betaToReleaseUpdatesEnabled.disabled)
{ advanced_settings.FW_Allow_Beta_Production_Up = betaToReleaseUpdatesEnabled.checked ? 'ENABLED' : 'DISABLED'; }

// 6) Auto-Backup - only if not disabled
// 6) Automatic Backups - only if not disabled //
let autobackupEnabled = document.getElementById('autobackupEnabled');
if (autobackupEnabled && !autobackupEnabled.disabled)
{ advanced_settings.FW_Auto_Backupmon = autobackupEnabled.checked ? 'ENABLED' : 'DISABLED'; }
Expand Down Expand Up @@ -2133,7 +2138,13 @@ function initializeCollapsibleSections()
<div>&nbsp;</div>
<div class="formfonttitle" id="headerTitle" style="text-align:center;">MerlinAU</div>
<div style="margin:10px 0 10px 5px;" class="splitLine"></div>
<div class="formfontdesc">This is the MerlinAU add-on integrated into the router WebUI.</div>
<div class="formfontdesc">This is the MerlinAU add-on integrated into the router WebUI
<span style="margin-left:8px;" id="WikiURL"">[
<a style="font-weight:bolder; text-decoration:underline; cursor:pointer;"
href="https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/wiki"
title="Go to MerlinAU Wiki page" target="_blank">Wiki</a> ]
</span>
</div>
<div style="line-height:10px;">&nbsp;</div>

<!-- Parent Table to Arrange Firmware and Settings Status Side by Side -->
Expand Down Expand Up @@ -2218,7 +2229,7 @@ function initializeCollapsibleSections()
<td style="padding: 4px; font-weight: bolder;" id="tailscaleVPNAccessStatus">Disabled</td>
</tr>
<tr>
<td style="padding: 4px; width: 180px;"><strong>Auto-Backup Enabled:</strong></td>
<td style="padding: 4px; width: 180px;"><strong>Automatic Backups:</strong></td>
<td style="padding: 4px; font-weight: bolder;" id="autobackupEnabledStatus">Disabled</td>
</tr>
<tr>
Expand Down Expand Up @@ -2465,7 +2476,12 @@ function initializeCollapsibleSections()
<td><input type="checkbox" id="autobackupEnabled" name="autobackupEnabled" /></td>
</tr>
<tr>
<td style="text-align: left;"><label for="Script_AutoUpdate_Check">Enable Auto-Updates for MerlinAU</label></td>
<td style="text-align: left;">
<label for="Script_AutoUpdate_Check">
<a class="hintstyle" name="ADDON_AUTO_UPDATES" href="javascript:void(0);"
onclick="ShowHintMsg(this);">Enable Auto-Updates for MerlinAU</a>
</label>
</td>
<td>
<input type="checkbox" id="Script_AutoUpdate_Check" name="Script_AutoUpdate_Check"/>
<span id="Script_AutoUpdate_SchedText" style="margin-left:10px; display:none; font-size: 12px; font-weight: bolder;"></span>
Expand Down
64 changes: 39 additions & 25 deletions MerlinAU.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
# Last Modified: 2025-Feb-21
# Last Modified: 2025-Feb-22
###################################################################
set -u

Expand Down Expand Up @@ -500,52 +500,62 @@ _ShowLogo_()
echo -e "${NOct}"
}

##---------------------------------------##
## Added by ExtremeFiretop [2024-Jul-03] ##
##---------------------------------------##
##----------------------------------------##
## Modified by Martinski W. [2025-Feb-22] ##
##----------------------------------------##
_ShowAbout_()
{
clear
_ShowLogo_
cat <<EOF
About
$SCRIPT_NAME is a tool for automating firmware updates on AsusWRT Merlin,
ensuring your router stays up-to-date with the latest features and security
patches. It simplifies the update process by automatically checking for,
downloading, and applying new firmware versions.
Developed by ExtremeFiretop and Martinski W.
$SCRIPT_NAME is a tool for automating firmware updates on AsusWRT-Merlin,
ensuring your router stays up-to-date with the latest features and
security patches. It greatly simplifies the firmware update process
by automatically checking for, downloading, and applying the latest
firmware version update that is currently available.
[Developed by ExtremeFiretop and Martinski W.]

License
$SCRIPT_NAME is free to use under the GNU General Public License
version 3 (GPL-3.0) https://opensource.org/licenses/GPL-3.0

Help & Support
https://www.snbforums.com/threads/merlinau-the-ultimate-firmware-auto-updater-addon.88577/

Wiki page:
https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/wiki

Source code
https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router
EOF
echo
_DoExit_ 0
}

##------------------------------------------##
## Modified by ExtremeFiretop [2024-Nov-18] ##
##------------------------------------------##
##----------------------------------------##
## Modified by Martinski W. [2025-Feb-22] ##
##----------------------------------------##
_ShowHelp_()
{
clear
_ShowLogo_
cat <<EOF
Available commands:
${SCRIPT_NAME}.sh about explains functionality
${SCRIPT_NAME}.sh help display available commands
${SCRIPT_NAME}.sh checkupdates check for available MerlinAU script updates
${SCRIPT_NAME}.sh forceupdate updates to latest version (force update)
${SCRIPT_NAME}.sh run_now run update process on router
${SCRIPT_NAME}.sh processNodes run update check on nodes
${SCRIPT_NAME}.sh develop switch to development branch
${SCRIPT_NAME}.sh stable switch to stable branch
${SCRIPT_NAME}.sh startup runs startup initialization & mounts WebUI page
${SCRIPT_NAME}.sh install installs add-on files
${SCRIPT_NAME}.sh uninstall uninstalls add-on files
${SCRIPT_NAME}.sh about describe add-on functionality
${SCRIPT_NAME}.sh help show available commands & Wiki URL
${SCRIPT_NAME}.sh checkupdates check for available MerlinAU updates
${SCRIPT_NAME}.sh forceupdate update to latest MerlinAU version
${SCRIPT_NAME}.sh run_now run F/W update process
${SCRIPT_NAME}.sh processNodes run update check on nodes
${SCRIPT_NAME}.sh develop switch to development branch
${SCRIPT_NAME}.sh stable switch to stable master branch
${SCRIPT_NAME}.sh startup run startup initialization actions
${SCRIPT_NAME}.sh install install MerlinAU files
${SCRIPT_NAME}.sh uninstall uninstall MerlinAU files

Wiki page:
https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/wiki
EOF
echo
_DoExit_ 0
Expand Down Expand Up @@ -7334,7 +7344,7 @@ _Toggle_FW_UpdateCheckSetting_()
}

##----------------------------------------##
## Modified by Martinski W. [2024-Oct-04] ##
## Modified by Martinski W. [2025-Feb-22] ##
##----------------------------------------##
_RemoveCronJobsFromAddOns_()
{
Expand Down Expand Up @@ -7375,7 +7385,10 @@ _RemoveCronJobsFromAddOns_()
Say "Cron jobs [$cronJobCount] from 3rd-party add-ons were found."
Say "---------------------------------------------------------------"

sleep 5
"$isInteractive" && \
printf "\nPlease wait to allow already started cron jobs to complete execution..."
sleep 15
"$isInteractive" && printf "\nDone.\n"
return 0
}

Expand Down Expand Up @@ -8459,6 +8472,7 @@ Please manually update to version ${GRNct}${MinSupportedFirmwareVers}${NOct} or
echo

# *WARNING*: NO MORE logging at this point & beyond #
sync ; sleep 2 ; echo 3 > /proc/sys/vm/drop_caches ; sleep 3
/sbin/ejusb -1 0 -u 1 2>/dev/null

#----------------------------------------------------------------------------------#
Expand Down