Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 48 additions & 20 deletions MerlinAU.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
#
# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
# Last Modified: 2024-Dec-01
# Last Modified: 2024-Dec-21
###################################################################
set -u

## Set version for each Production Release ##
readonly SCRIPT_VERSION=1.3.8
readonly SCRIPT_VERSION=1.3.9
readonly SCRIPT_NAME="MerlinAU"
## Set to "master" for Production Releases ##
SCRIPT_BRANCH="dev"
Expand Down Expand Up @@ -4704,9 +4704,9 @@ _TranslateCronSchedHR_()
infoStrDAYS="every $freqNumDAYW days of the week, in every month"
elif echo "$theCronDAYW" | grep -qE "[,-]"
then
infoStrDAYS="days $theCronDAYW of the week, in every month"
infoStrDAYS="days ${theCronDAYW}, in every month"
else
infoStrDAYS="day $theCronDAYW of the week, in every month"
infoStrDAYS="day ${theCronDAYW}, in every month"
fi
elif [ "$theCronDAYM" != "*" ]
then
Expand Down Expand Up @@ -4736,7 +4736,7 @@ _TranslateCronSchedHR_()
else
hasFreqMINS=false ; freqNumMINS=""
fi
if [ "$theCronHOUR" = "*" ] && [ "$theCronMINS" -eq 0 ]
if [ "$theCronHOUR" = "*" ] && [ "$theCronMINS" = "0" ]
then
schedInfoStr="Every hour"
elif [ "$theCronHOUR" = "*" ] && [ "$theCronMINS" = "*" ]
Expand All @@ -4745,7 +4745,7 @@ _TranslateCronSchedHR_()
elif [ "$theCronHOUR" = "*" ] && _IsValidNumber_ "$theCronMINS"
then
schedInfoStr="Every hour at minute $theCronMINS"
elif "$hasFreqHOUR" && [ "$theCronMINS" -eq 0 ]
elif "$hasFreqHOUR" && [ "$theCronMINS" = "0" ]
then
schedInfoStr="Every $freqNumHOUR hours"
elif "$hasFreqHOUR" && [ "$theCronMINS" = "*" ]
Expand Down Expand Up @@ -4774,12 +4774,12 @@ _TranslateCronSchedHR_()
schedInfoStr="$theCronHOUR, every $freqNumMINS minutes"
elif [ "$theCronHOUR" = "*" ]
then
schedInfoStr="Every hour, Minutes: $theCronMINS"
schedInfoStr="Every hour, Minutes: $theCronMINS"
elif [ "$theCronMINS" = "*" ]
then
schedInfoStr="$theCronHOUR, every minute"
else
schedInfoStr="$theCronHOUR, Minutes: $theCronMINS"
schedInfoStr="$theCronHOUR, Minutes: $theCronMINS"
fi
echo "${schedInfoStr}, $infoStrDAYS"
}
Expand Down Expand Up @@ -5116,15 +5116,25 @@ _ShowCronMenuHeader_()
printf "${SEPstr}\n"
}

##-------------------------------------##
## Added by Martinski W. [2024-Nov-24] ##
##-------------------------------------##
##----------------------------------------##
## Modified by Martinski W. [2024-Dec-20] ##
##----------------------------------------##
_GetCronScheduleInputDAYofMONTH_()
{
if [ $# -eq 0 ] || [ -z "$1" ] ; then return 1 ; fi
local oldSchedDAYM="$1" newSchedDAYM
local oldSchedDAYM newSchedDAYM oldSchedDAYHR

_GetSchedDaysHR_()
{
local cruDAYS="$1"
[ "$1" = "*" ] && cruDAYS="Every day"
echo "$cruDAYS"
}

newSchedDAYM=""
oldSchedDAYM="$1"
oldSchedDAYHR="$(_GetSchedDaysHR_ "$1")"

while true
do
_ShowCronMenuHeader_
Expand All @@ -5136,7 +5146,7 @@ _GetCronScheduleInputDAYofMONTH_()
printf " ${GRNct}*/7${NOct}=Every 7 days ${GRNct}*/10${NOct}=Every 10 days ${GRNct}*/15${NOct}=Every 15 days\n"

printf "\n[${menuCancelAndExitStr}]\n"
printf "\nEnter ${GRNct}DAYS of the MONTH${NOct} [1-31] ${GRNct}${oldSchedDAYM}${NOct}?: "
printf "\nEnter ${GRNct}DAYS of the MONTH${NOct} [1-31] ${GRNct}${oldSchedDAYHR}${NOct}?: "
read -r newSchedDAYM
if [ -z "$newSchedDAYM" ]
then
Expand All @@ -5154,15 +5164,32 @@ _GetCronScheduleInputDAYofMONTH_()
return 0
}

##-------------------------------------##
## Added by Martinski W. [2024-Nov-24] ##
##-------------------------------------##
##----------------------------------------##
## Modified by Martinski W. [2024-Dec-20] ##
##----------------------------------------##
_GetCronScheduleInputDAYofWEEK_()
{
if [ $# -eq 0 ] || [ -z "$1" ] ; then return 1 ; fi
local oldSchedDAYW="$1" newSchedDAYW
local oldSchedDAYW newSchedDAYW oldSchedDAYHR

_DayOfWeekNumToDayName_()
{ echo "$1" | sed 's/0/Sun/;s/1/Mon/;s/2/Tue/;s/3/Wed/;s/4/Thu/;s/5/Fri/;s/6/Sat/;' ; }

_GetSchedDaysHR_()
{
local cruDAYS="$1"
if [ "$1" = "*" ]
then cruDAYS="Every day"
elif ! echo "$1" | grep -qE "^[*]/.*"
then cruDAYS="$(_DayOfWeekNumToDayName_ "$1")"
fi
echo "$cruDAYS"
}

newSchedDAYW=""
oldSchedDAYW="$1"
oldSchedDAYHR="$(_GetSchedDaysHR_ "$1")"

while true
do
_ShowCronMenuHeader_
Expand All @@ -5176,7 +5203,7 @@ _GetCronScheduleInputDAYofWEEK_()
printf " ${GRNct}6,0${NOct}=Sat,Sun ${GRNct}1,3,5${NOct}=Mon,Wed,Fri ${GRNct}2,4${NOct}=Tue,Thu\n"

printf "\n[${menuCancelAndExitStr}] [${menuSavedThenExitStr}] [${menuReturnToBeginStr}]\n"
printf "\nEnter ${GRNct}DAYS of the WEEK${NOct} [0-6] ${GRNct}${oldSchedDAYW}${NOct}?: "
printf "\nEnter ${GRNct}DAYS of the WEEK${NOct} [0-6] ${GRNct}${oldSchedDAYHR}${NOct}?: "
read -r newSchedDAYW
if [ -z "$newSchedDAYW" ]
then
Expand Down Expand Up @@ -8529,7 +8556,7 @@ _ShowMainMenu_()
}

##----------------------------------------##
## Modified by Martinski W. [2024-Nov-25] ##
## Modified by Martinski W. [2024-Dec-20] ##
##----------------------------------------##
_ShowAdvancedOptionsMenu_()
{
Expand All @@ -8545,7 +8572,8 @@ _ShowAdvancedOptionsMenu_()
printf "\n${padStr}[Current Path: ${GRNct}${FW_ZIP_DIR}${NOct}]\n"

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

BetaProductionSetting="$(Get_Custom_Setting "FW_Allow_Beta_Production_Up")"
printf "\n ${GRNct}3${NOct}. Toggle Beta-to-Release F/W Updates"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MerlinAU - AsusWRT-Merlin Firmware Auto Updater
## v1.3.8
## 2024-Dec-01
## v1.3.9
## 2024-Dec-21

![image](https://github.com/user-attachments/assets/185f9fe4-acdb-419a-8154-ab6fa6e0fd46)
![image](https://github.com/user-attachments/assets/8f22818d-2118-4c47-a54a-e54fb147fd6b)
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.8
1.3.9
Loading