From a7a614f429373b6364e4fda5415742a8348a17e1 Mon Sep 17 00:00:00 2001 From: Sandro Date: Wed, 2 Nov 2022 16:04:50 +0100 Subject: [PATCH] Remove unused code --- .../sops-import-keys-hook/sops-import-keys-hook.bash | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pkgs/sops-import-keys-hook/sops-import-keys-hook.bash b/pkgs/sops-import-keys-hook/sops-import-keys-hook.bash index 8a2e9e0..0224633 100644 --- a/pkgs/sops-import-keys-hook/sops-import-keys-hook.bash +++ b/pkgs/sops-import-keys-hook/sops-import-keys-hook.bash @@ -1,11 +1,3 @@ -_sopsAddKey() { - @gpg@ --quiet --import "$key" - local fpr - # only add the first fingerprint, this way we ignore subkeys - fpr=$(@gpg@ --with-fingerprint --with-colons --show-key "$key" \ - | awk -F: '$1 == "fpr" { print $10; exit }') -} - sopsImportKeysHook() { local key dir if [ -n "${sopsCreateGPGHome}" ]; then @@ -14,14 +6,14 @@ sopsImportKeysHook() { fi for key in ${sopsPGPKeys-}; do if [[ -f "$key" ]]; then - _sopsAddKey "$key" + @gpg@ --quiet --import "$key" else echo "$key does not exists" >&2 fi done for dir in ${sopsPGPKeyDirs-}; do while IFS= read -r -d '' key; do - _sopsAddKey "$key" + @gpg@ --quiet --import "$key" done < <(find -L "$dir" -type f \( -name '*.gpg' -o -name '*.asc' \) -print0) done }