#!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '== listening TCP sockets =='
if command -v lsof >/dev/null 2>&1; then lsof -nP -iTCP -sTCP:LISTEN || true; elif command -v ss >/dev/null 2>&1; then ss -lntp || true; else printf '%s\n' 'neither lsof nor ss is available'; fi
