Commit 2b6434e8 authored by Konstantin Gribov's avatar Konstantin Gribov Committed by Robby Russell
Browse files

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.
parent e7c9bf8d
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment