mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
feat: add completion for fail2ban-client
This commit is contained in:
parent
136298e110
commit
925c979afc
2 changed files with 154 additions and 0 deletions
37
plugins/fail2ban/README.md
Normal file
37
plugins/fail2ban/README.md
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# fail2ban-client
|
||||
|
||||
## Description
|
||||
|
||||
Zsh completion for the `fail2ban-client` command.
|
||||
This plugin provides:
|
||||
|
||||
- Completion for subcommands (`start`, `restart`, `reload`, `stop`, `unban`, `status`, `set`, `get`, `add`, etc.)
|
||||
- Dynamic completion of active jails
|
||||
- Contextual completion of options for `set` and `get` (e.g., `bantime`, `maxretry`, `ignoreip`, etc.)
|
||||
- Automatic handling of `sudo` if required
|
||||
|
||||
## Installation
|
||||
|
||||
To use it, add **fail2ban** to the plugins array in your zshrc file:
|
||||
|
||||
```bash
|
||||
plugins=(... fail2ban)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Type `fail2ban-client <TAB>` to trigger completion.
|
||||
Examples:
|
||||
|
||||
```bash
|
||||
fail2ban-client set <TAB> # suggests jails
|
||||
fail2ban-client set sshd <TAB> # suggests possible actions
|
||||
fail2ban-client get sshd <TAB> # suggests available properties
|
||||
fail2ban-client status <TAB> # suggests jails or the 'extended' option
|
||||
```
|
||||
|
||||
## Compatibility
|
||||
|
||||
- Zsh version 5.x or higher
|
||||
- Works with or without root access (uses `sudo` if needed)
|
||||
- Designed to be used as a plugin in Oh My Zsh
|
||||
Loading…
Add table
Add a link
Reference in a new issue