feat: 更新 iptables 别名,添加对 ufw 状态的检查
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
2aeb16e9f7
commit
de87ded3de
@ -13,7 +13,11 @@ alias hg='history | grep'
|
|||||||
command_exists() { command -v "$@" >/dev/null 2>&1; }
|
command_exists() { command -v "$@" >/dev/null 2>&1; }
|
||||||
|
|
||||||
if command_exists iptables; then
|
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
|
if [ -f "/etc/network/iptables-load" ]; then
|
||||||
alias ipe='sudo vi /etc/network/iptables-load'
|
alias ipe='sudo vi /etc/network/iptables-load'
|
||||||
alias ips='sudo /etc/network/iptables-load'
|
alias ips='sudo /etc/network/iptables-load'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user