You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
334 B
15 lines
334 B
#!/bin/ksh
|
|
|
|
exposed_tcp_in=$(netstat -l -n -finet -ptcp |\
|
|
awk '$4 !~ /^127\.0\.0\.1.*$/ && $1 == "tcp" {print $4}')
|
|
|
|
output=""
|
|
if [ ! -z "$exposed_tcp_in" ]; then
|
|
output=$output"[ "
|
|
for i in $exposed_tcp_in; do
|
|
port="${i##*.}"
|
|
output="$output\"$port\","
|
|
done
|
|
output=${output%?}" ]"
|
|
fi
|
|
echo $output
|
|
|