Thursday, December 31, 2015

How to delete specific IPv6 rule of UFW

eg. ufw allow 22/tcp
echo y | ufw delete $(ufw status numbered | grep 22/tcp.*v6 | cut -c 2,3)

or script:
delv6=$(ufw status numbered | grep 22/tcp.*v6 | cut -c 3)
if [ -n "$delv6" ]; then
echo y | ufw delete $delv6
fi
unset delv6

No comments:

Post a Comment

一些有用的网站

Windows系统安装界面认不到硬盘,加载RST驱动: https://iknow.lenovo.com.cn/detail/419926.html 纯净版Flash: https://gitlab.com/cleanflash/installer/-/releases    ...