chezmoi init
This commit is contained in:
commit
530d6d7195
1176 changed files with 111325 additions and 0 deletions
22
dot_oh-my-zsh/plugins/firewalld/README.md
Normal file
22
dot_oh-my-zsh/plugins/firewalld/README.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
# 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 |
|
17
dot_oh-my-zsh/plugins/firewalld/firewalld.plugin.zsh
Normal file
17
dot_oh-my-zsh/plugins/firewalld/firewalld.plugin.zsh
Normal file
|
@ -0,0 +1,17 @@
|
|||
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\|sources')}")
|
||||
|
||||
for i in $zones; do
|
||||
sudo firewall-cmd --zone ${i/ \(default\)} --list-all
|
||||
done
|
||||
|
||||
echo 'Direct Rules:'
|
||||
sudo firewall-cmd --direct --get-all-rules
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue