summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-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