This commit is contained in:
2026-03-20 00:04:46 +01:00
parent 3e39731465
commit 90786f2faf
13 changed files with 439 additions and 34 deletions

26
encrypt-interactiv.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Prüfen, ob ein Dateiname als Argument übergeben wurde
if [ -z "$1" ]; then
echo "Usage: $0 <filename>"
exit 1
fi
DATEI="$1"
# Prüfen, ob ansible-vault existiert und ausführbar ist
if ! command -v ansible-vault >/dev/null 2>&1; then
echo "Fehler: 'ansible-vault' ist nicht installiert oder nicht im PATH."
exit 2
fi
# Prüfen, ob die angegebene Datei existiert
if [ ! -f "$DATEI" ]; then
echo "Fehler: Datei '$DATEI' existiert nicht."
exit 3
fi
# Befehl ausführen
ansible-vault encrypt --ask-vault-pass "$DATEI"
exit 0