arch-install/scripts/setup_gpg.sh
Ariejan de Vroom e3aaee336c
Some checks failed
Lint / Lint (3.10) (push) Failing after 16s
Lint / Lint (3.11) (push) Failing after 19s
Update to macos install
2024-06-10 16:23:13 +02:00

24 lines
605 B
Bash
Executable File

#!/usr/bin/env -S bash -i
copy_to_clipboard() {
if [[ "$OSTYPE" == "darwin"* ]]; then
pbcopy
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
xclip -selection clipboard
else
echo "Unsupported operating system"
exit 1
fi
}
echo "--- Grabbing GPG Passpharse from Bitwarden to clipboard"
rbw get "GPG Passphrase" | copy_to_clipboard
echo "--- Importing private/public key"
rbw get "GPG Private/Pub Key (Ariejan)" | gpg --import
echo "--- Setting key trust"
gpg --list-keys --fingerprint --with-colons |
sed -E -n -e 's/^fpr:::::::::([0-9A-F]+):$/\1:6:/p' |
gpg --import-ownertrust