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
2022-04-19 13:46:35 -07:00
# Copyright (c) 2018-2022, diyIT.org
2021-04-01 01:23:14 -07:00
# 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