Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
c3a87e7d
Commit
c3a87e7d
authored
Sep 12, 2016
by
Marc Cornellà
Committed by
GitHub
Sep 12, 2016
Browse files
Add FirewallD plugin (#5386)
parents
3ad92a57
db31d515
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/firewalld/firewalld.plugin.zsh
0 → 100644
View file @
c3a87e7d
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
}
plugins/firewalld/readme.md
0 → 100644
View file @
c3a87e7d
# FirewallD Plugin
This plugin adds some aliases and functions for FirewallD using the
`firewalld-cmd`
command. To use it, add firewalld to your plugins array.
```
zsh
plugins
=(
... firewalld
)
```
## Aliases
| Alias | Command | Description |
| :---- | :----------------------------------------- | :--------------------------- |
| fw |
`sudo firewall-cmd`
| Shorthand |
| fwr |
`sudo firewall-cmd --reload`
| Reload current configuration |
| fwp |
`sudo firewall-cmd --permanent`
| Create permanent rule |
| fwrp |
`sudo firewall-cmd --runtime-to-permanent`
| Save current configuration |
## Functions
| Function | Description |
| :------- | :--------------------------------------------------------- |
| fwl | Lists configuration from all active zones and direct rules |
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment