#!/usr/local/bin/bash # Copyright (c) 2018-2022, diyIT.org # All rights reserved. # # BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License") # https://diyit.org/license/ # # for jail in $(jls -h name | tail +2); do sudo jexec $jail netstat -LAan 2>/dev/null | grep -q $1; if [ $? -eq 0 ]; then echo "found in jail $jail"; fi; done