setup.sh v1.1: auto-install cron if not present
This commit is contained in:
8
setup.sh
8
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"
|
||||
|
||||
Reference in New Issue
Block a user