firewalld.plugin.zsh 438 Bytes
Newer Older
Rob Ede's avatar
Rob Ede committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
alias fw="firewall-cmd"
alias fwp="firewall-cmd --permanent"
alias fwr="firewall-cmd --reload"
alias fwrp="firewall-cmd --runtime-to-permanent"

function fwl () {
  # converts output to zsh array ()
  # @f flag split on new line
  zones=("${(@f)$(firewall-cmd --get-active-zones | grep -v interfaces)}")

  for i in $zones; do
    firewall-cmd --zone $i --list-all
  done

  echo 'Direct Rules:'
  firewall-cmd --direct --get-all-rules
}