firewalld.plugin.zsh 484 B

123456789101112131415161718
  1. alias fw="sudo firewall-cmd"
  2. alias fwp="sudo firewall-cmd --permanent"
  3. alias fwr="sudo firewall-cmd --reload"
  4. alias fwrp="sudo firewall-cmd --runtime-to-permanent"
  5. function fwl () {
  6. # converts output to zsh array ()
  7. # @f flag split on new line
  8. zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v 'interfaces\|sources')}")
  9. for i in $zones; do
  10. sudo firewall-cmd --zone $i --list-all
  11. done
  12. echo 'Direct Rules:'
  13. sudo firewall-cmd --direct --get-all-rules
  14. }