summaryrefslogtreecommitdiff
path: root/templates/reprepro-export-key.sh.erb
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2012-07-02 18:13:50 +0200
committerintrigeri <intrigeri@boum.org>2012-07-02 18:13:50 +0200
commitffa04c84b2bc78d5add63a7ba98660a0a668cb64 (patch)
tree101bf27d9ae092e134a5ed11c6f196f595352db0 /templates/reprepro-export-key.sh.erb
parent01d03ee604fc54a9dd8ea0e530e97872a3a43363 (diff)
parent973608ff1999ae385fad392e1344ec57348481be (diff)
Merge branch 'improve-pubkey-export'
Diffstat (limited to 'templates/reprepro-export-key.sh.erb')
-rw-r--r--templates/reprepro-export-key.sh.erb5
1 files changed, 4 insertions, 1 deletions
diff --git a/templates/reprepro-export-key.sh.erb b/templates/reprepro-export-key.sh.erb
index c99f06b..e619e24 100644
--- a/templates/reprepro-export-key.sh.erb
+++ b/templates/reprepro-export-key.sh.erb
@@ -3,5 +3,8 @@
KEY="`gpg --homedir <%= basedir %>/.gnupg --with-colon --list-secret-keys | cut -d : -f 5 | head -n 1`"
if [ ! -z "$KEY" ]; then
- gpg --homedir <%= basedir %>/.gnupg --export --armor $KEY > <%= basedir %>/key.asc
+ tempfile=$(mktemp)
+ gpg --homedir <%= basedir %>/.gnupg --export --armor $KEY > "$tempfile"
+ mv "$tempfile" <%= basedir %>/key.asc
+ chmod 0664 <%= basedir %>/key.asc
fi