2019-03-11 19:00:03 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-01-11 20:13:32 +01:00
|
|
|
set -euo pipefail
|
2019-03-11 19:00:03 +01:00
|
|
|
|
|
|
|
# Run this script to import all of the information exported by `export.sh`.
|
2022-01-11 20:13:32 +01:00
|
|
|
# Usage: ./import.sh path/to/export.zip
|
2019-03-11 19:00:03 +01:00
|
|
|
|
2022-01-11 20:13:32 +01:00
|
|
|
if [ -z "${1+x}" ]; then
|
|
|
|
echo "You must specify the path to export.zip. Exiting..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
destination="$(mktemp -d)"
|
|
|
|
|
|
|
|
function cleanup() {
|
|
|
|
rm -rf "${destination}"
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
unzip "${1}" -d "${destination}" >/dev/null
|
|
|
|
|
|
|
|
gpg --import "${destination}/public.asc"
|
|
|
|
gpg --import "${destination}/secret.asc"
|
|
|
|
gpg --import-ownertrust "${destination}/ownertrust.txt"
|
2019-03-11 19:00:03 +01:00
|
|
|
|
|
|
|
# Run this at the end to output some verification
|
|
|
|
gpg --list-keys
|
2022-01-11 20:13:32 +01:00
|
|
|
gpg --list-secret-keys
|