1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-16 10:50:07 +00:00
ohmyzsh/plugins/firewalld/firewalld.plugin.zsh

18 lines
484 B
Bash
Raw Normal View History

2016-09-07 23:05:43 +00:00
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"
2016-09-07 11:56:19 +00:00
function fwl () {
# converts output to zsh array ()
# @f flag split on new line
zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v 'interfaces\|sources')}")
2016-09-07 11:56:19 +00:00
for i in $zones; do
2016-09-07 23:05:43 +00:00
sudo firewall-cmd --zone $i --list-all
2016-09-07 11:56:19 +00:00
done
echo 'Direct Rules:'
2016-09-07 23:05:43 +00:00
sudo firewall-cmd --direct --get-all-rules
2016-09-07 11:56:19 +00:00
}