diff --git a/cdist/conf/type/__apt_key/gencode-remote b/cdist/conf/type/__apt_key/gencode-remote index 47c8bb49..e9daa524 100755 --- a/cdist/conf/type/__apt_key/gencode-remote +++ b/cdist/conf/type/__apt_key/gencode-remote @@ -48,11 +48,11 @@ curl -s -L \\ -o "$keyfile" \\ "$uri" -if grep -Fq 'BEGIN PGP PUBLIC KEY BLOCK' \\ - "$keyfile" +key="\$( cat "$keyfile" )" + +if echo "\$key" | grep -Fq 'BEGIN PGP PUBLIC KEY BLOCK' then - cat "$keyfile" \\ - | gpg --export > "$keyfile" + echo "\$key" | gpg --dearmor > "$keyfile" fi EOF