Skip to content

Commit

Permalink
Fixed fwl function in firewalld plugin when sources used (ohmyz…
Browse files Browse the repository at this point in the history
…sh#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.
  • Loading branch information
grossws authored and robbyrussell committed Aug 29, 2018
1 parent 4560b5c commit aefc434
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/firewalld/firewalld.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aefc434

Please sign in to comment.