Skip to content

Commit

Permalink
Update MerlinAU.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ExtremeFiretop authored Jul 28, 2024
1 parent 7afe01f commit 80e79ae
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions MerlinAU.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,7 @@ check_memory_and_prompt_reboot()
# Attempt to clear clears pagecache, dentries, and inodes after shutting down services
Say "Attempting to free up memory once more even more aggressively..."

# Stop Entware services before F/W flash #
# Stop Entware services to free some memory #
_EntwareServicesHandler_ stop

_ShutDownNonCriticalServices_
Expand Down Expand Up @@ -4734,7 +4734,7 @@ _Toggle_FW_UpdateCheckSetting_()
}

##----------------------------------------##
## Modified by Martinski W. [2024-Jun-28] ##
## Modified by Martinski W. [2024-Jul-24] ##
##----------------------------------------##
_EntwareServicesHandler_()
{
Expand All @@ -4757,6 +4757,9 @@ _EntwareServicesHandler_()
*) return 1 ;;
esac

# Check if *NOT* skipping any services #
[ $# -gt 1 ] && [ "$2" = "-noskip" ] && skipServiceList=""

_RenameSkippedService_()
{
[ -z "$skippedServiceList" ] && return 1
Expand All @@ -4775,8 +4778,8 @@ _EntwareServicesHandler_()

[ -n "$serviceStr" ] && Say "Looking for Entware services..."

# Filter out services to skip and add a skip message #
if [ "$AllowVPN" = "ENABLED" ]
# Filter out services to skip and add a "skip message" #
if [ "$AllowVPN" = "ENABLED" ] && [ -n "$skipServiceList" ]
then
for skipService in $skipServiceList
do
Expand Down Expand Up @@ -5348,9 +5351,6 @@ Please manually update to version $minimum_supported_version or higher to use th
# Send last email notification before F/W flash #
_SendEMailNotification_ START_FW_UPDATE_STATUS

# Stop Entware services before F/W flash #
_EntwareServicesHandler_ stop

##------------------------------------------##
## Modified by ExtremeFiretop [2024-Jun-30] ##
##------------------------------------------##
Expand Down Expand Up @@ -5416,15 +5416,24 @@ Please manually update to version $minimum_supported_version or higher to use th
Say "Flashing ${GRNct}${firmware_file}${NOct}... ${REDct}Please wait for reboot in about 4 minutes or less.${NOct}"
echo

# *WARNING*: No more logging at this point & beyond #
/sbin/ejusb -1 0 -u 1

#-------------------------------------------------------
# Stop toggling LEDs during the F/W flash to avoid
# modifying NVRAM during the actual flash process.
#-------------------------------------------------------
_Reset_LEDs_

##----------------------------------------##
## Modified by Martinski W. [2024-Jul-24] ##
##----------------------------------------##
# Remove SIGHUP to allow script to continue #
trap '' HUP

# Stop Entware services WITHOUT exceptions BEFORE the F/W flash #
_EntwareServicesHandler_ stop -noskip

# *WARNING*: NO MORE logging at this point & beyond #
/sbin/ejusb -1 0 -u 1

nohup curl -k "${routerURLstr}/upgrade.cgi" \
--referer "${routerURLstr}/Advanced_FirmwareUpgrade_Content.asp" \
--user-agent 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0' \
Expand Down Expand Up @@ -5464,6 +5473,7 @@ Please manually update to version $minimum_supported_version or higher to use th
# reboot by itself after the process returns, do it now.
#----------------------------------------------------------#
sleep 180
_ReleaseLock_
/sbin/service reboot
else
Say "${REDct}**ERROR**${NOct}: Login failed. Please try the following:
Expand Down

0 comments on commit 80e79ae

Please sign in to comment.