~增加对ss命令的兼容以替代netstat命令

This commit is contained in:
juewuy
2026-07-29 10:42:38 +08:00
parent db8ba09663
commit d8941fb202
4 changed files with 18 additions and 6 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ set_dns_mod() {
;;
*)
if [ "$num" -ge 1 ] && [ "$num" -lt 65535 ]; then
if ckcmd netstat && netstat -ntul | grep -q ":$num "; then
if netstat -ntul 2>/dev/null | grep -q ":$num " || ss -ntul 2>/dev/null | grep -q ":$num "; then
dns_redir_port="$num"
setconfig dns_redir_port "$dns_redir_port"
common_success