44#
55# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
66# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
7- # Last Modified: 2024-Jan-30
7+ # Last Modified: 2024-Jan-31
88# ##################################################################
99set -u
1010
@@ -2330,6 +2330,7 @@ _EntwareServicesHandler_()
23302330
23312331 if [ -n " $actionStr " ]
23322332 then
2333+ " $isInteractive " && \
23332334 printf " \n${actionStr} Entware services... Please wait.\n"
23342335 $entwOPT_unslung $1 ; sleep 5
23352336 printf " \nDone.\n"
@@ -2793,10 +2794,10 @@ Please manually update to version $minimum_supported_version or higher to use th
27932794 # so that the F/W Update can start without interruptions.
27942795 # ------------------------------------------------------------#
27952796 " $isInteractive " && printf " \nRestarting web server... Please wait.\n"
2796- /sbin/service restart_httpd &
2797+ /sbin/service restart_httpd > /dev/null 2>&1 &
27972798 sleep 5
27982799
2799- # Send last email notification before flash #
2800+ # Send last email notification before F/W flash #
28002801 _SendEMailNotification_ START_FW_UPDATE_STATUS
28012802
28022803 # Check if '/opt/bin/diversion' exists #
@@ -2806,7 +2807,7 @@ Please manually update to version $minimum_supported_version or higher to use th
28062807 /opt/bin/diversion unmount
28072808 fi
28082809
2809- # Stop entware services before flash #
2810+ # Stop entware services before F/W flash #
28102811 _EntwareServicesHandler_ stop
28112812
28122813 curl_response=" $( curl " ${routerURLstr} /login.cgi" \
@@ -2833,6 +2834,12 @@ Please manually update to version $minimum_supported_version or higher to use th
28332834 # *WARNING*: No more logging at this point & beyond #
28342835 _UnmountUSBDrives_
28352836
2837+ # -------------------------------------------------------
2838+ # Stop toggling LEDs during the F/W flash to avoid
2839+ # modifying NVRAM during the actual flash process.
2840+ # -------------------------------------------------------
2841+ _Reset_LEDs_
2842+
28362843 nohup curl " ${routerURLstr} /upgrade.cgi" \
28372844 --referer ${routerURLstr} /Advanced_FirmwareUpgrade_Content.asp \
28382845 --user-agent ' Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0' \
@@ -2848,6 +2855,7 @@ Please manually update to version $minimum_supported_version or higher to use th
28482855 -F " file=@${firmware_file} " \
28492856 --cookie /tmp/cookie.txt > /tmp/upload_response.txt 2>&1 &
28502857 curlPID=$!
2858+
28512859 # ----------------------------------------------------------#
28522860 # In the rare case that the F/W Update gets "stuck" for
28532861 # some reason & the "curl" cmd never returns, we create
@@ -2869,10 +2877,8 @@ Please manually update to version $minimum_supported_version or higher to use th
28692877 # ----------------------------------------------------------#
28702878 # Let's wait for 3 minutes here. If the router does not
28712879 # reboot by itself after the process returns, do it now.
2872- # Restart the LEDs with a "slower" blinking rate.
28732880 # ----------------------------------------------------------#
2874- _Reset_LEDs_ ; Toggle_LEDs 3 & Toggle_LEDs_PID=$!
2875- sleep 180 ; _Reset_LEDs_ 1
2881+ sleep 180
28762882 /sbin/service reboot
28772883 else
28782884 Say " ${REDct} **ERROR**${NOct} : Login failed. Please try the following:
0 commit comments