mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 05:40:11 -08:00
Add .env backup system for Docker containers
- backup-env-files.sh: Main backup script with Gitea integration - validate-env-backups.sh: Validation and integrity checking - env-backup-integration.sh: Integration with existing backup system - completions/env-backup-completion.bash: Tab completion support - docs/env-backup-system.md: Documentation for the backup system These scripts provide secure backup of .env files to private Gitea repository.
This commit is contained in:
50
completions/env-backup-completion.bash
Normal file
50
completions/env-backup-completion.bash
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# env-backup-completion.bash - Bash completion for environment backup scripts
|
||||
# Source this file or copy to ~/.local/share/bash-completion/completions/
|
||||
|
||||
_backup_env_files() {
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
opts="--help --init --force --dry-run --restore --list --gitea-url --username"
|
||||
|
||||
case ${prev} in
|
||||
--gitea-url|-g)
|
||||
# Suggest common gitea URL patterns
|
||||
COMPREPLY=( $(compgen -W "https://git. https://gitea. https://code." -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
--username|-u)
|
||||
# No completion for username
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
}
|
||||
|
||||
_validate_env_backups() {
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
opts="--help --verbose --summary-only --missing-only --diff"
|
||||
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
}
|
||||
|
||||
# Register completion functions
|
||||
complete -F _backup_env_files backup-env-files.sh
|
||||
complete -F _validate_env_backups validate-env-backups.sh
|
||||
|
||||
# Also register for the full path versions
|
||||
complete -F _backup_env_files ./backup-env-files.sh
|
||||
complete -F _validate_env_backups ./validate-env-backups.sh
|
||||
Reference in New Issue
Block a user