From de87ded3de469f612431004d2dad28115b29f8d7 Mon Sep 17 00:00:00 2001 From: Konano Date: Sun, 26 Apr 2026 17:59:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20iptables=20?= =?UTF-8?q?=E5=88=AB=E5=90=8D=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=AF=B9=20ufw=20?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=9A=84=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot --- files/zsh/51-alias.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/zsh/51-alias.zsh b/files/zsh/51-alias.zsh index 90e7499..8d92923 100644 --- a/files/zsh/51-alias.zsh +++ b/files/zsh/51-alias.zsh @@ -13,7 +13,11 @@ alias hg='history | grep' command_exists() { command -v "$@" >/dev/null 2>&1; } if command_exists iptables; then - alias ipl='sudo iptables -L -n -v' + if command_exists ufw && sudo ufw status | grep -q "Status: active"; then + alias ipl='sudo ufw status' + else + alias ipl='sudo iptables -L -n -v' + fi if [ -f "/etc/network/iptables-load" ]; then alias ipe='sudo vi /etc/network/iptables-load' alias ips='sudo /etc/network/iptables-load'