setup.sh v1.1: auto-install cron if not present

This commit is contained in:
pdmarf
2026-04-17 23:23:21 +01:00
parent c1c94e624e
commit a548f7c3b3

View File

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