Skip to content

Commit 3635d62

Browse files
Merge pull request #375 from Martinski4GitHub/dev
Minor UI Improvement
2 parents eb09c9f + e548e78 commit 3635d62

File tree

3 files changed

+51
-23
lines changed

3 files changed

+51
-23
lines changed

MerlinAU.sh

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
#
55
# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
66
# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
7-
# Last Modified: 2024-Dec-01
7+
# Last Modified: 2024-Dec-21
88
###################################################################
99
set -u
1010

1111
## Set version for each Production Release ##
12-
readonly SCRIPT_VERSION=1.3.8
12+
readonly SCRIPT_VERSION=1.3.9
1313
readonly SCRIPT_NAME="MerlinAU"
1414
## Set to "master" for Production Releases ##
1515
SCRIPT_BRANCH="dev"
@@ -4704,9 +4704,9 @@ _TranslateCronSchedHR_()
47044704
infoStrDAYS="every $freqNumDAYW days of the week, in every month"
47054705
elif echo "$theCronDAYW" | grep -qE "[,-]"
47064706
then
4707-
infoStrDAYS="days $theCronDAYW of the week, in every month"
4707+
infoStrDAYS="days ${theCronDAYW}, in every month"
47084708
else
4709-
infoStrDAYS="day $theCronDAYW of the week, in every month"
4709+
infoStrDAYS="day ${theCronDAYW}, in every month"
47104710
fi
47114711
elif [ "$theCronDAYM" != "*" ]
47124712
then
@@ -4736,7 +4736,7 @@ _TranslateCronSchedHR_()
47364736
else
47374737
hasFreqMINS=false ; freqNumMINS=""
47384738
fi
4739-
if [ "$theCronHOUR" = "*" ] && [ "$theCronMINS" -eq 0 ]
4739+
if [ "$theCronHOUR" = "*" ] && [ "$theCronMINS" = "0" ]
47404740
then
47414741
schedInfoStr="Every hour"
47424742
elif [ "$theCronHOUR" = "*" ] && [ "$theCronMINS" = "*" ]
@@ -4745,7 +4745,7 @@ _TranslateCronSchedHR_()
47454745
elif [ "$theCronHOUR" = "*" ] && _IsValidNumber_ "$theCronMINS"
47464746
then
47474747
schedInfoStr="Every hour at minute $theCronMINS"
4748-
elif "$hasFreqHOUR" && [ "$theCronMINS" -eq 0 ]
4748+
elif "$hasFreqHOUR" && [ "$theCronMINS" = "0" ]
47494749
then
47504750
schedInfoStr="Every $freqNumHOUR hours"
47514751
elif "$hasFreqHOUR" && [ "$theCronMINS" = "*" ]
@@ -4774,12 +4774,12 @@ _TranslateCronSchedHR_()
47744774
schedInfoStr="$theCronHOUR, every $freqNumMINS minutes"
47754775
elif [ "$theCronHOUR" = "*" ]
47764776
then
4777-
schedInfoStr="Every hour, Minutes: $theCronMINS"
4777+
schedInfoStr="Every hour, Minutes: $theCronMINS"
47784778
elif [ "$theCronMINS" = "*" ]
47794779
then
47804780
schedInfoStr="$theCronHOUR, every minute"
47814781
else
4782-
schedInfoStr="$theCronHOUR, Minutes: $theCronMINS"
4782+
schedInfoStr="$theCronHOUR, Minutes: $theCronMINS"
47834783
fi
47844784
echo "${schedInfoStr}, $infoStrDAYS"
47854785
}
@@ -5116,15 +5116,25 @@ _ShowCronMenuHeader_()
51165116
printf "${SEPstr}\n"
51175117
}
51185118

5119-
##-------------------------------------##
5120-
## Added by Martinski W. [2024-Nov-24] ##
5121-
##-------------------------------------##
5119+
##----------------------------------------##
5120+
## Modified by Martinski W. [2024-Dec-20] ##
5121+
##----------------------------------------##
51225122
_GetCronScheduleInputDAYofMONTH_()
51235123
{
51245124
if [ $# -eq 0 ] || [ -z "$1" ] ; then return 1 ; fi
5125-
local oldSchedDAYM="$1" newSchedDAYM
5125+
local oldSchedDAYM newSchedDAYM oldSchedDAYHR
5126+
5127+
_GetSchedDaysHR_()
5128+
{
5129+
local cruDAYS="$1"
5130+
[ "$1" = "*" ] && cruDAYS="Every day"
5131+
echo "$cruDAYS"
5132+
}
51265133

51275134
newSchedDAYM=""
5135+
oldSchedDAYM="$1"
5136+
oldSchedDAYHR="$(_GetSchedDaysHR_ "$1")"
5137+
51285138
while true
51295139
do
51305140
_ShowCronMenuHeader_
@@ -5136,7 +5146,7 @@ _GetCronScheduleInputDAYofMONTH_()
51365146
printf " ${GRNct}*/7${NOct}=Every 7 days ${GRNct}*/10${NOct}=Every 10 days ${GRNct}*/15${NOct}=Every 15 days\n"
51375147

51385148
printf "\n[${menuCancelAndExitStr}]\n"
5139-
printf "\nEnter ${GRNct}DAYS of the MONTH${NOct} [1-31] ${GRNct}${oldSchedDAYM}${NOct}?: "
5149+
printf "\nEnter ${GRNct}DAYS of the MONTH${NOct} [1-31] ${GRNct}${oldSchedDAYHR}${NOct}?: "
51405150
read -r newSchedDAYM
51415151
if [ -z "$newSchedDAYM" ]
51425152
then
@@ -5154,15 +5164,32 @@ _GetCronScheduleInputDAYofMONTH_()
51545164
return 0
51555165
}
51565166

5157-
##-------------------------------------##
5158-
## Added by Martinski W. [2024-Nov-24] ##
5159-
##-------------------------------------##
5167+
##----------------------------------------##
5168+
## Modified by Martinski W. [2024-Dec-20] ##
5169+
##----------------------------------------##
51605170
_GetCronScheduleInputDAYofWEEK_()
51615171
{
51625172
if [ $# -eq 0 ] || [ -z "$1" ] ; then return 1 ; fi
5163-
local oldSchedDAYW="$1" newSchedDAYW
5173+
local oldSchedDAYW newSchedDAYW oldSchedDAYHR
5174+
5175+
_DayOfWeekNumToDayName_()
5176+
{ echo "$1" | sed 's/0/Sun/;s/1/Mon/;s/2/Tue/;s/3/Wed/;s/4/Thu/;s/5/Fri/;s/6/Sat/;' ; }
5177+
5178+
_GetSchedDaysHR_()
5179+
{
5180+
local cruDAYS="$1"
5181+
if [ "$1" = "*" ]
5182+
then cruDAYS="Every day"
5183+
elif ! echo "$1" | grep -qE "^[*]/.*"
5184+
then cruDAYS="$(_DayOfWeekNumToDayName_ "$1")"
5185+
fi
5186+
echo "$cruDAYS"
5187+
}
51645188

51655189
newSchedDAYW=""
5190+
oldSchedDAYW="$1"
5191+
oldSchedDAYHR="$(_GetSchedDaysHR_ "$1")"
5192+
51665193
while true
51675194
do
51685195
_ShowCronMenuHeader_
@@ -5176,7 +5203,7 @@ _GetCronScheduleInputDAYofWEEK_()
51765203
printf " ${GRNct}6,0${NOct}=Sat,Sun ${GRNct}1,3,5${NOct}=Mon,Wed,Fri ${GRNct}2,4${NOct}=Tue,Thu\n"
51775204

51785205
printf "\n[${menuCancelAndExitStr}] [${menuSavedThenExitStr}] [${menuReturnToBeginStr}]\n"
5179-
printf "\nEnter ${GRNct}DAYS of the WEEK${NOct} [0-6] ${GRNct}${oldSchedDAYW}${NOct}?: "
5206+
printf "\nEnter ${GRNct}DAYS of the WEEK${NOct} [0-6] ${GRNct}${oldSchedDAYHR}${NOct}?: "
51805207
read -r newSchedDAYW
51815208
if [ -z "$newSchedDAYW" ]
51825209
then
@@ -8529,7 +8556,7 @@ _ShowMainMenu_()
85298556
}
85308557

85318558
##----------------------------------------##
8532-
## Modified by Martinski W. [2024-Nov-25] ##
8559+
## Modified by Martinski W. [2024-Dec-20] ##
85338560
##----------------------------------------##
85348561
_ShowAdvancedOptionsMenu_()
85358562
{
@@ -8545,7 +8572,8 @@ _ShowAdvancedOptionsMenu_()
85458572
printf "\n${padStr}[Current Path: ${GRNct}${FW_ZIP_DIR}${NOct}]\n"
85468573

85478574
printf "\n ${GRNct}2${NOct}. Set F/W Update Cron Schedule"
8548-
printf "\n${padStr}[Current Schedule: ${GRNct}${FW_UpdateCronJobSchedule}${NOct}]\n"
8575+
printf "\n${padStr}[Current Schedule: ${GRNct}${FW_UpdateCronJobSchedule}${NOct}]"
8576+
printf "\n${padStr}[${GRNct}%s${NOct}]\n" "$(_TranslateCronSchedHR_ "$FW_UpdateCronJobSchedule")"
85498577

85508578
BetaProductionSetting="$(Get_Custom_Setting "FW_Allow_Beta_Production_Up")"
85518579
printf "\n ${GRNct}3${NOct}. Toggle Beta-to-Release F/W Updates"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MerlinAU - AsusWRT-Merlin Firmware Auto Updater
2-
## v1.3.8
3-
## 2024-Dec-01
2+
## v1.3.9
3+
## 2024-Dec-21
44

55
![image](https://github.com/user-attachments/assets/185f9fe4-acdb-419a-8154-ab6fa6e0fd46)
66
![image](https://github.com/user-attachments/assets/8f22818d-2118-4c47-a54a-e54fb147fd6b)

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.8
1+
1.3.9

0 commit comments

Comments
 (0)