Skip to content

Commit

Permalink
Set a better filtering on listening ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Soubinan committed Nov 3, 2024
1 parent aef8037 commit c560376
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion __layout.k
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ _welcome_msg_cron = """\
_welcome_msg_script = """\
#!/bin/bash

ports=$(ss -ptuln | grep -vE 'systemd|next-router|next-render|127.0.0.|%lo' | awk '/^tcp/ && $4 !~ /^(127\.|::1|0\.0\.0\.0)/ {print $5}' | awk -F: '{print $NF}' | sort -u)
ports=$(ss -ptuln '( sport > :1023 or sport = :80 or sport = :443 )' | grep -vE 'systemd|next-router|next-render|127.0.0.|%lo' | awk '/^tcp/ && $4 !~ /^(127\.|::1|0\.0\.0\.0)/ {print $5}' | awk -F: '{print $NF}' | sort -u)
num_ports=$(echo $ports | wc -l)
ips=$(ip a|grep 'inet '|awk '{print $2}')

Expand Down

0 comments on commit c560376

Please sign in to comment.