#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SKILL_ROOT="$(dirname "$SCRIPT_DIR")" source "$SKILL_ROOT/scripts/_common.sh" : "${HTTP_PORT:=3000}" : "${SSH_PORT:=2222}" main() { if command -v ss >/dev/null 2>&1; then ss -ltn | awk '{print $4}' | grep -q ":$HTTP_PORT$" && die "HTTP_PORT $HTTP_PORT already in use" ss -ltn | awk '{print $4}' | grep -q ":$SSH_PORT$" && die "SSH_PORT $SSH_PORT already in use" else log_warn "ss not available; skipping port checks." fi log_info "Ports appear free." } main "$@"