Conversation
Signed-off-by: aj970 <akshaya_j@comcast.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the cron initialization logic to conditionally skip scheduling selfheal_aggressive.sh for a specific platform (WNXL11BWL) while keeping other SelfHeal cron jobs intact.
Changes:
- Gate creation of the
selfheal_aggressive.shcron entry behind aBOX_TYPE != WNXL11BWLcheck. - Move
AggressiveIntervalretrieval/defaulting inside the new platform guard.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| if [ -z "$AGGRESSIVE_INTERVAL" ]; then | ||
| AGGRESSIVE_INTERVAL=5 | ||
| fi |
There was a problem hiding this comment.
AGGRESSIVE_INTERVAL comes from syscfg and is interpolated directly into a cron schedule. If it contains non-numeric characters/whitespace (e.g., empty, 0, or a value with spaces), this can generate an invalid crontab line or allow cron field injection. Consider validating it as a positive integer (and enforcing a sane min/max) before appending to $CRONTAB_FILE, falling back to the default when invalid.
| if [ -z "$AGGRESSIVE_INTERVAL" ]; then | |
| AGGRESSIVE_INTERVAL=5 | |
| fi | |
| # Validate AGGRESSIVE_INTERVAL as a positive integer within sane bounds; fallback to default (5) if invalid | |
| case "$AGGRESSIVE_INTERVAL" in | |
| ''|*[!0-9]*) | |
| AGGRESSIVE_INTERVAL=5 | |
| ;; | |
| *) | |
| if [ "$AGGRESSIVE_INTERVAL" -eq 0 ] || [ "$AGGRESSIVE_INTERVAL" -gt 1440 ]; then | |
| AGGRESSIVE_INTERVAL=5 | |
| fi | |
| ;; | |
| esac |
358d703 to
1f8ff46
Compare
Checking