From a415bdaeb542b09d821fe9c9bee7906071f41a25 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sat, 23 Oct 2021 16:07:39 -0700 Subject: 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 Autosubmit: wpcarro --- users/wpcarro/configs/.gnupg/export.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'users') diff --git a/users/wpcarro/configs/.gnupg/export.sh b/users/wpcarro/configs/.gnupg/export.sh index 571689773b0e..bb047e9e3b91 100755 --- a/users/wpcarro/configs/.gnupg/export.sh +++ b/users/wpcarro/configs/.gnupg/export.sh @@ -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") -- cgit 1.4.1