2021-04-19 11:41:46 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ "$#" == "0" ]; then
|
|
|
|
echo "Usage: $0 your-pgp-key-name-here"
|
|
|
|
echo "If the script says the file isn't found, make sure"
|
|
|
|
echo "you placed it on your DOTFILES_HOME/secrets/pgp directory"
|
2021-04-25 10:09:34 +02:00
|
|
|
exit
|
2021-04-19 11:41:46 +02:00
|
|
|
fi
|
2021-04-25 10:09:34 +02:00
|
|
|
|
|
|
|
PGP_KEY_EXPORT_FILE="$HOME/.dotfiles/secrets/pgp/$1.pgp.sec"
|
|
|
|
echo "info: Export file: ~/.dotfiles/secrets/pgp/$1.pgp.sec"
|
|
|
|
PASSPHRASE_BASE64=$(cat ~/.dotfiles/secrets/pgp/passphrase-$PGP_KEY_EXPORT_FILE)
|
|
|
|
echo "info: Base64'd file contents: $PASSPHRASE_BASE64"
|
|
|
|
echo $PASSPHARSE_BASE64 | base64 -d
|