Skip to content

Commit

Permalink
Merge pull request #10 from Martinski4GitHub/master
Browse files Browse the repository at this point in the history
Fixed cron jobs display issue on WebGUI
  • Loading branch information
decoderman authored Oct 20, 2024
2 parents c230bd1 + 17159df commit c492875
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 48 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# scMerlin

## v2.5.7
### Updated on 2024-Sep-22 by @decoderman with updates from @Martinski4GitHub
## v2.5.8
### Updated on 2024-Sep-29 by @decoderman with updates from @Martinski4GitHub

## About
scMerlin allows you to easily control the most common services/scripts on your router. scMerlin also augments your router's WebUI with a Sitemap and dynamic submenus for the main left menu of Asuswrt-Merlin.
Expand Down
27 changes: 13 additions & 14 deletions scmerlin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## https://github.com/jackyaz/scMerlin ##
## ##
######################################################
# Last Modified: 2024-Sep-22
# Last Modified: 2024-Sep-29
#-----------------------------------------------------

########## Shellcheck directives ###########
Expand All @@ -27,8 +27,8 @@
### Start of script variables ###
readonly SCRIPT_NAME="scMerlin"
readonly SCRIPT_NAME_LOWER="$(echo "$SCRIPT_NAME" | tr 'A-Z' 'a-z' | sed 's/d//')"
readonly SCM_VERSION="v2.5.7"
readonly SCRIPT_VERSION="v2.5.7"
readonly SCM_VERSION="v2.5.8"
readonly SCRIPT_VERSION="v2.5.8"
SCRIPT_BRANCH="master"
SCRIPT_REPO="https://raw.githubusercontent.com/decoderman/$SCRIPT_NAME/$SCRIPT_BRANCH"
readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME_LOWER.d"
Expand Down Expand Up @@ -915,23 +915,22 @@ EOF
}

##----------------------------------------##
## Modified by Martinski W. [2024-May-25] ##
## Modified by Martinski W. [2024-Sep-29] ##
##----------------------------------------##
Get_Cron_Jobs()
{
printf "%-27s┌────────── minute (0 - 59)\\n" " "
printf "%-27s│%-8s┌──────── hour (0 - 23)\\n" " " " "
printf "%-27s│%-8s│%-8s┌────── day of month (1 - 31)\\n" " " " " " "
printf "%-27s│%-8s│%-8s│%-8s┌──── month (1 - 12)\\n" " " " " " " " "
printf "%-27s│%-8s│%-8s│%-8s│%-8s┌── day of week (0 - 6 => Sunday - Saturday)\\n" " " " " " " " " " "
printf "%-27s│%-8s│%-8s│%-8s│%-8s│\\n" " " " " " " " " " "
printf "%-27s↓%-8s↓%-8s↓%-8s↓%-8s↓\\n" " " " " " " " " " "
printf "${GRNct}%-25s %-8s %-8s %-8s %-8s %-9s %s${CLEARFORMAT}\n" \
"Cron job name" "Min" "Hour" "DayM" "Month" "DayW" "Command"
printf "%-27s│%-9s┌──────── hour (0 - 23)\\n" " " " "
printf "%-27s│%-9s│%-9s┌────── day of month (1 - 31)\\n" " " " " " "
printf "%-27s│%-9s│%-9s│%-9s┌──── month (1 - 12)\\n" " " " " " " " "
printf "%-27s│%-9s│%-9s│%-9s│%-9s┌── day of week (0 - 6 => Sunday - Saturday)\\n" " " " " " " " " " "
printf "%-27s│%-9s│%-9s│%-9s│%-9s│\\n" " " " " " " " " " "
printf "%-27s↓%-9s↓%-9s↓%-9s↓%-9s↓\\n" " " " " " " " " " "
printf "${GRNct}%-25s %-9s %-9s %-9s %-9s %-10s %s${CLEARFORMAT}\n" "Cron Job Name" "Min" "Hour" "DayM" "Month" "DayW" "Command"
cronjobs="$(eval $cronListCmd | awk 'FS="#" {printf "%s %s\n",$2,$1}' | awk '{printf "%-25s %-9s %-9s %-9s %-9s %-10s ",$1,$2,$3,$4,$5,$6;for(i=7; i<=NF; ++i) printf "%s ", $i; print ""}')"
echo "$cronjobs"
eval $cronListCmd | sed 's/,/|/g' | awk 'FS="#" {printf "%s %s\n",$2,$1}' | \
awk '{printf "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"",$1,$2,$3,$4,$5,$6;for(i=7; i<=NF; ++i) printf "%s ", $i; print "\""}' | sed 's/ "$/"/g' > /tmp/scmcronjobs.tmp
cronjobs="$(eval $cronListCmd | awk 'FS="#" {printf "%s %s\n",$2,$1}' | awk '{printf "%-25s %-8s %-8s %-8s %-8s %-10s",$1,$2,$3,$4,$5,$6;for(i=7; i<=NF; ++i) printf "%s ", $i; print ""}')"
echo "$cronjobs"
}

Get_Addon_Pages(){
Expand Down
Loading

0 comments on commit c492875

Please sign in to comment.