|
4 | 4 | # |
5 | 5 | # Original Creation Date: 2023-Oct-01 by @ExtremeFiretop. |
6 | 6 | # Official Co-Author: @Martinski W. - Date: 2023-Nov-01 |
7 | | -# Last Modified: 2024-Jan-30 |
| 7 | +# Last Modified: 2024-Jan-31 |
8 | 8 | ################################################################### |
9 | 9 | set -u |
10 | 10 |
|
@@ -2279,55 +2279,6 @@ _Toggle_FW_UpdateCheckSetting_() |
2279 | 2279 | _WaitForEnterKey_ "$menuReturnPromptStr" |
2280 | 2280 | } |
2281 | 2281 |
|
2282 | | -##-------------------------------------## |
2283 | | -## Added by Martinski W. [2024-Jan-30] ## |
2284 | | -##-------------------------------------## |
2285 | | -_SleepCounter_() |
2286 | | -{ |
2287 | | - if [ $# -lt 1 ] || [ -z "$1" ] || \ |
2288 | | - ! echo "$1" | grep -qE "^[1-9][0-9]*[sm]?$" |
2289 | | - then return 1 ; fi |
2290 | | - |
2291 | | - if ! "$isInteractive" |
2292 | | - then sleep $1 ; return 0 ; fi |
2293 | | - |
2294 | | - local counter numStr="$1" |
2295 | | - local maxCounterSecs numCounterSecs |
2296 | | - |
2297 | | - if [ $# -lt 2 ] || [ -z "$2" ] || \ |
2298 | | - ! echo "$2" | grep -qE "^(up|down)$" |
2299 | | - then counter=up |
2300 | | - else counter="$2" |
2301 | | - fi |
2302 | | - |
2303 | | - case "$numStr" in |
2304 | | - [1-9]s|[1-9][0-9]*s) |
2305 | | - numStr="${numStr%%s*}" |
2306 | | - ;; |
2307 | | - [1-9]m|[1-9][0-9]*m) |
2308 | | - numStr="${numStr%%m*}" |
2309 | | - numStr="$((numStr * 60))" |
2310 | | - ;; |
2311 | | - esac |
2312 | | - |
2313 | | - case "$counter" in |
2314 | | - up) numCounterSecs=0 ; maxCounterSecs="$numStr" ;; |
2315 | | - down) maxCounterSecs=0 ; numCounterSecs="$numStr" ;; |
2316 | | - esac |
2317 | | - |
2318 | | - while true |
2319 | | - do |
2320 | | - numLen="${#numCounterSecs}" |
2321 | | - printf "\r\033[0K[%*d sec. ]" "$((numLen + 1))" "$numCounterSecs" |
2322 | | - if [ "$counter" = "down" ] |
2323 | | - then [ "$((numCounterSecs--))" -le 0 ] && break |
2324 | | - else [ "$((numCounterSecs++))" -ge "$maxCounterSecs" ] && break |
2325 | | - fi |
2326 | | - sleep 1 |
2327 | | - done |
2328 | | - echo |
2329 | | -} |
2330 | | - |
2331 | 2282 | ##-------------------------------------## |
2332 | 2283 | ## Added by Martinski W. [2024-Jan-25] ## |
2333 | 2284 | ##-------------------------------------## |
@@ -2356,7 +2307,7 @@ _EntwareServicesHandler_() |
2356 | 2307 | then |
2357 | 2308 | "$isInteractive" && \ |
2358 | 2309 | printf "\n${actionStr} Entware services... Please wait.\n" |
2359 | | - $entwOPT_unslung $1 ; _SleepCounter_ 5 |
| 2310 | + $entwOPT_unslung $1 ; sleep 5 |
2360 | 2311 | printf "\nDone.\n" |
2361 | 2312 | fi |
2362 | 2313 | } |
@@ -2815,7 +2766,7 @@ Please manually update to version $minimum_supported_version or higher to use th |
2815 | 2766 | #------------------------------------------------------------# |
2816 | 2767 | "$isInteractive" && printf "\nRestarting web server... Please wait.\n" |
2817 | 2768 | /sbin/service restart_httpd >/dev/null 2>&1 & |
2818 | | - _SleepCounter_ 5 |
| 2769 | + sleep 5 |
2819 | 2770 |
|
2820 | 2771 | # Send last email notification before F/W flash # |
2821 | 2772 | _SendEMailNotification_ START_FW_UPDATE_STATUS |
@@ -2898,7 +2849,7 @@ Please manually update to version $minimum_supported_version or higher to use th |
2898 | 2849 | # Let's wait for 3 minutes here. If the router does not |
2899 | 2850 | # reboot by itself after the process returns, do it now. |
2900 | 2851 | #----------------------------------------------------------# |
2901 | | - _SleepCounter_ 180 down |
| 2852 | + sleep 180 |
2902 | 2853 | /sbin/service reboot |
2903 | 2854 | else |
2904 | 2855 | Say "${REDct}**ERROR**${NOct}: Login failed. Please try the following: |
|
0 commit comments