Skip to content

Commit 3c21999

Browse files
Update MerlinAU.sh
Removed "_SleepCounter_()" function. Not needed.
1 parent b49b749 commit 3c21999

1 file changed

Lines changed: 4 additions & 53 deletions

File tree

MerlinAU.sh

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
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
###################################################################
99
set -u
1010

@@ -2279,55 +2279,6 @@ _Toggle_FW_UpdateCheckSetting_()
22792279
_WaitForEnterKey_ "$menuReturnPromptStr"
22802280
}
22812281

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-
23312282
##-------------------------------------##
23322283
## Added by Martinski W. [2024-Jan-25] ##
23332284
##-------------------------------------##
@@ -2356,7 +2307,7 @@ _EntwareServicesHandler_()
23562307
then
23572308
"$isInteractive" && \
23582309
printf "\n${actionStr} Entware services... Please wait.\n"
2359-
$entwOPT_unslung $1 ; _SleepCounter_ 5
2310+
$entwOPT_unslung $1 ; sleep 5
23602311
printf "\nDone.\n"
23612312
fi
23622313
}
@@ -2815,7 +2766,7 @@ Please manually update to version $minimum_supported_version or higher to use th
28152766
#------------------------------------------------------------#
28162767
"$isInteractive" && printf "\nRestarting web server... Please wait.\n"
28172768
/sbin/service restart_httpd >/dev/null 2>&1 &
2818-
_SleepCounter_ 5
2769+
sleep 5
28192770

28202771
# Send last email notification before F/W flash #
28212772
_SendEMailNotification_ START_FW_UPDATE_STATUS
@@ -2898,7 +2849,7 @@ Please manually update to version $minimum_supported_version or higher to use th
28982849
# Let's wait for 3 minutes here. If the router does not
28992850
# reboot by itself after the process returns, do it now.
29002851
#----------------------------------------------------------#
2901-
_SleepCounter_ 180 down
2852+
sleep 180
29022853
/sbin/service reboot
29032854
else
29042855
Say "${REDct}**ERROR**${NOct}: Login failed. Please try the following:

0 commit comments

Comments
 (0)