diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-03-11 16:47:59 -0500 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-03-11 16:47:59 -0500 |
commit | f03e852a6e166795eb663d41d005668bf1aa4ebd (patch) | |
tree | dc0ce07facd4258deafad171bcbbf789572792c5 | |
parent | b48e024ee336e6bc36a0547d055da25bbe3564cd (diff) | |
download | pgpkeys-f03e852a6e166795eb663d41d005668bf1aa4ebd.tar.gz |
Check if dirs exist before processing any keys
Bail early if the keys directory or wotmate directory don't exist.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | scripts/korg-update-pgpkeys | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/korg-update-pgpkeys b/scripts/korg-update-pgpkeys index 22d9015..651e3d8 100644 --- a/scripts/korg-update-pgpkeys +++ b/scripts/korg-update-pgpkeys @@ -23,6 +23,14 @@ if [[ -z $1 ]]; then echo "e.g.: $0 /tmp/msg.eml" exit 1 fi +if [[ ! -d $PGPKEYSDIR ]]; then + echo "$PGPKEYSDIR does not exist" + exit 1 +fi +if [[ ! -d $WOTMATEDIR ]]; then + echo "$WOTMATEDIR does not exist" + exit 1 +fi GPGTMPHOME=$(mktemp -d) GPG="/usr/bin/gpg2 --batch --homedir ${GPGTMPHOME}" |