FreeBSD/scripts/find-sonewconn.sh

17 lines
367 B
Bash
Raw Normal View History

2021-04-01 01:23:14 -07:00
#!/usr/local/bin/bash
# Copyright (c) 2018-2021, 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