From 2b6434e8793a876e5465edd9c75819166878aba6 Mon Sep 17 00:00:00 2001 From: Konstantin Gribov Date: Wed, 29 Aug 2018 21:57:02 +0300 Subject: [PATCH] Fixed `fwl` function in `firewalld` plugin when `sources` used (#7011) `firewall-cmd --get-active-zones` returns something like this: ``` dmz sources: ipset:dmz-hosts public interfaces: eth0 ``` if zone binding is based on source ips, so strings with `sources: ...` should be excluded along with `interfaces: ...` to get zones list. --- plugins/firewalld/firewalld.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/firewalld/firewalld.plugin.zsh b/plugins/firewalld/firewalld.plugin.zsh index bfbf6f48f..5b1090636 100644 --- a/plugins/firewalld/firewalld.plugin.zsh +++ b/plugins/firewalld/firewalld.plugin.zsh @@ -6,7 +6,7 @@ alias fwrp="sudo firewall-cmd --runtime-to-permanent" function fwl () { # converts output to zsh array () # @f flag split on new line - zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v interfaces)}") + zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v 'interfaces\|sources')}") for i in $zones; do sudo firewall-cmd --zone $i --list-all