mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 03:20:12 -08:00
feat: Add help flag support to enhanced crontab management script installation
This commit is contained in:
@@ -271,7 +271,7 @@ validate_crontab_syntax() {
|
||||
local errors=0
|
||||
|
||||
while IFS= read -r line; do
|
||||
((line_num++))
|
||||
line_num=$((line_num + 1))
|
||||
|
||||
# Skip comments and empty lines
|
||||
if [[ "$line" =~ ^[[:space:]]*# ]] || [[ "$line" =~ ^[[:space:]]*$ ]]; then
|
||||
@@ -279,9 +279,9 @@ validate_crontab_syntax() {
|
||||
fi
|
||||
|
||||
# Basic cron format validation
|
||||
if [[ ! "$line" =~ ^[[:space:]]*([0-9*,-]+[[:space:]]+){4}[0-9*,-]+[[:space:]].+ ]]; then
|
||||
if ! [[ "$line" =~ ^[[:space:]]*([0-9*,-]+[[:space:]]+){4}[0-9*,-]+[[:space:]].+ ]]; then
|
||||
log_error "Line $line_num: Invalid cron format: $line"
|
||||
((errors++))
|
||||
errors=$((errors + 1))
|
||||
fi
|
||||
|
||||
# Check for common issues
|
||||
|
||||
Reference in New Issue
Block a user