feat(wpcarro/gpg): Zip output from configs/.gnupg/export.sh

This makes it easier to `scp` to the new host.

Change-Id: If746a71204c97255547b579252622005b4d13b20
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4793
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
This commit is contained in:
William Carroll 2021-10-23 16:07:39 -07:00 committed by wpcarro
parent fad38387af
commit a415bdaeb5

View file

@ -9,13 +9,16 @@ set -e
destination="${1:-$(mktemp -d)}"
if [ ! -d "$destination" ]; then
echo "$destination does not exist. Creating it..."
mkdir -p "$destination"
if [ ! -d "${destination}" ]; then
echo "${destination} does not exist. Creating it..."
mkdir -p "${destination}"
fi
gpg --armor --export >"$destination/public.asc"
gpg --armor --export-secret-keys >"$destination/secret.asc"
gpg --armor --export-ownertrust >"$destination/ownertrust.txt"
gpg --armor --export >"${destination}/public.asc"
gpg --armor --export-secret-keys >"${destination}/secret.asc"
gpg --armor --export-ownertrust >"${destination}/ownertrust.txt"
echo $(realpath "$destination")
zip -r "${destination}.zip" "${destination}"
rm -rf "${destination}"
echo $(realpath "${destination}.zip")