diff --git a/setup.sh b/setup.sh index cf8b5ce..d7579ea 100755 --- a/setup.sh +++ b/setup.sh @@ -46,6 +46,14 @@ EOF echo "whitelist.conf created — add known-safe items to suppress false positives." fi +# ── Ensure cron is available ────────────────────────────────────────────────── +if ! command -v crontab &>/dev/null; then + echo "cron not found — installing..." + apt install cron -y + systemctl enable cron + systemctl start cron +fi + # ── Cron jobs ────────────────────────────────────────────────────────────────── CRON_1="0 8 * * * $SCRIPT_DIR/npm-security-check.sh >> $SCRIPT_DIR/logs/npm-security-check-\$(date +\%Y\%m\%d).log 2>&1" CRON_2="5 8 * * * $SCRIPT_DIR/check-nextjs-rce.sh >> $SCRIPT_DIR/logs/check-nextjs-rce-\$(date +\%Y\%m\%d).log 2>&1"