this commit adds a lot of shit, look at the shit, too much sorry

Signed-off-by: Menno van Leeuwen <menno@vleeuwen.me>
This commit is contained in:
2024-08-24 01:35:46 +02:00
parent 379b1b97ec
commit 183b688617
52 changed files with 580 additions and 453 deletions

View File

@@ -26,7 +26,13 @@ if [[ "$2" == "decrypt" ]]; then
for file in ~/.ssh/config.d/*.gpg; do
filename=$(basename $file .gpg)
gpg --quiet --batch --yes --decrypt --passphrase="$password" --output ~/.ssh/config.d/$filename.conf $file
# Add .conf to the filename but only if it doesn't already have it
if [[ $filename != *.conf ]]; then
filename="$filename.conf"
fi
gpg --quiet --batch --yes --decrypt --passphrase="$password" --output ~/.ssh/config.d/$filename $file
done
elif [[ "$2" == "encrypt" ]]; then
printfe "%s\n" "cyan" "Encrypting .ssh/config.d/ files..."