diff --git a/plugins/firewalld/README.md b/plugins/firewalld/README.md index 8b5bc74d4..70465c001 100644 --- a/plugins/firewalld/README.md +++ b/plugins/firewalld/README.md @@ -8,15 +8,16 @@ 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 | +| 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 | +| Function | Description | +| :--------- | :---------------------------------------------------------------------------------------- | +| `fwl` | Lists configuration from all active zones and direct rules | +| `fwbackup` | Saves the current firewall configuration by copying all zone files to `~/firewall-backup` | diff --git a/plugins/firewalld/firewalld.plugin.zsh b/plugins/firewalld/firewalld.plugin.zsh index 478919f6f..78b56e6d4 100644 --- a/plugins/firewalld/firewalld.plugin.zsh +++ b/plugins/firewalld/firewalld.plugin.zsh @@ -16,6 +16,7 @@ function fwl () { sudo firewall-cmd --direct --get-all-rules } +# backup function fwbackup() { sudo firewall-cmd --runtime-to-permanent mkdir -p ~/firewall-backup