Files
NeilClack 05bb98b107
Build Dev ISOs / build-dev-android (push) Canceled after 0s
Build Dev ISOs / build-dev-commercial (push) Canceled after 0s
Build Dev ISOs / build-dev-kiosk (push) Canceled after 1m10s
Enable live app updater on production variants
All variants now follow the same update procedure as the dev flakes;
prod variants pull the RadiantWave binary, Attic repo, and manifest
from the radiantwave channel instead of radiantwave-dev.
2026-08-28 16:37:13 -05:00

42 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env zsh
#
# find_systems.zsh
# Sweeps a subnet for hosts with SSH open, then queries each as `kiosk`
# for hostname + NixOS configuration revision.
#
# Usage: ./find_systems.zsh [subnet]
# subnet defaults to 192.168.4.0/24
set -uo pipefail # no -e: we want to keep going past unreachable hosts
SUBNET="${1:-192.168.1.0/24}"
SSH_USER="kiosk"
SSH_OPTS=(-o BatchMode=yes -o ConnectTimeout=5 -o StrictHostKeyChecking=accept-new)
echo "Scanning $SUBNET for open SSH (22)..."
ips=("${(@f)$(nmap -p 22 --open -Pn "$SUBNET" -oG - | awk '/22\/open/ {print $2}')}")
if [[ ${#ips[@]} -eq 0 ]]; then
echo "No hosts with open SSH found on $SUBNET."
exit 0
fi
echo "Found ${#ips[@]} host(s). Querying..."
echo
fail_count=0
for ip in "${ips[@]}"; do
echo "== $ip =="
if ssh "${SSH_OPTS[@]}" "${SSH_USER}@${ip}" \
'echo "host: $(hostname)"; echo "rev: $(nixos-version --configuration-revision)"'; then
:
else
echo " (unreachable or auth failed)"
((fail_count++))
fi
echo
done
echo "Done. ${fail_count} of ${#ips[@]} host(s) failed to respond."