15 lines
1.0 KiB
Bash
15 lines
1.0 KiB
Bash
#!/usr/bin/env bash
|
|||
|
|
# Team footprint snapshot: everything a team owns, so a delete can be proven
|
||
|
|
# rather than assumed. Usage: ./team_footprint.sh <idx> [label]
|
||
|
|
set -uo pipefail
|
||
|
|
IDX=${1:-5}
|
||
|
|
LABEL=${2:-team$IDX}
|
||
|
|
echo "=== $LABEL ($IDX) ==="
|
||
|
|
echo " containers : $(docker ps --format '{{.Names}}' | grep -c "_container_team${IDX}\$")"
|
||
|
|
echo " sidecars : $(docker ps --format '{{.Names}}' | grep -c "team${IDX}-.*-1\$")"
|
||
|
|
echo " network : $(docker network ls --format '{{.Name}}' | grep -c "^team${IDX}_default\$")"
|
||
|
|
echo " volumes : $(docker volume ls --format '{{.Name}}' | grep -c "^team${IDX}")"
|
||
|
|
echo " dir : $([ -d "/opt/gemastik18-final/teams/team${IDX}" ] && echo present || echo GONE)"
|
||
|
|
echo " recv unit : $(systemctl is-active "gemastik-receiver-team${IDX}.service" 2>/dev/null || echo GONE)"
|
||
|
|
echo " ufw rules : $(ufw status | grep -cE " 3${IDX}0[0-9]{2}/tcp| 3${IDX}[1-9][0-9]{2}/tcp")"
|
||
|
|
echo " traefik : $(grep -c "team${IDX}" /data/coolify/proxy/dynamic/attackdefense-teams.yaml 2>/dev/null || echo 0)"
|