feat: Add help flag support to enhanced crontab management script installation

This commit is contained in:
Peter Wood
2025-05-26 10:59:31 -04:00
parent aec4878502
commit 458683d395
5 changed files with 64 additions and 39 deletions

View File

@@ -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