mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-15 09:58:47 -07:00
add firewalld aliases
This commit is contained in:
parent
71201ffd67
commit
e726af8f83
17
plugins/firewalld/firewalld.plugin.zsh
Normal file
17
plugins/firewalld/firewalld.plugin.zsh
Normal file
@ -0,0 +1,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
|
||||
}
|
Loading…
Reference in New Issue
Block a user