1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-24 13:21:57 +00:00
ohmyzsh/plugins/firewalld/firewalld.plugin.zsh
2016-09-08 00:05:55 +01:00

17 lines
473 B
Bash

alias fw="sudo firewall-cmd"
alias fwp="sudo firewall-cmd --permanent"
alias fwr="sudo firewall-cmd --reload"
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)}")
for i in $zones; do
sudo firewall-cmd --zone $i --list-all
done
echo 'Direct Rules:'
sudo firewall-cmd --direct --get-all-rules
}