Helper scripts

This commit is contained in:
2026-11-15 17:42:41 +01:00
parent b2f1baaac5
commit 39ba6bd7da
22 changed files with 2233 additions and 0 deletions

17
scripts/reboot-check.sh Normal file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Read-only recovery inspection. Never reboots either the sensor or VIPERA.
set -euo pipefail
VM="${VM:-yuru@192.168.100.84}"
KEY="${LEAF_SSH_KEY:-$HOME/.ssh/id_ed25519_alice}"
ssh -F /dev/null -o BatchMode=yes -o ConnectTimeout=8 -i "$KEY" "$VM" '
set -eu
[ "$(hostname)" = LEAF-PROTO ]
systemctl is-active --quiet leaf-controller suricata-leaf leaf-eve-rotate.timer
systemctl is-enabled --quiet leaf-controller suricata-leaf leaf-eve-rotate.timer
[ "$(findmnt -n -o FSTYPE --target /var/log/suricata-leaf)" = tmpfs ]
sudo -n test -S /run/suricata/alerts.sock
printf "boot_id="; cat /proc/sys/kernel/random/boot_id
uptime -s
sudo -n python3 /opt/leaf-controller/tools/leaf-live-helper.py status
printf "RECOVERY INSPECTION PASS (no reboot performed)\n"
'