summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-05-09 00:47:38 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-05-09 00:47:38 -0300
commit5d92c6169661a5833bdc73df738e1a6a36840f23 (patch)
treeb570d16495c6f9377b8b25ada46374d8beb9d193
parent5d29b8b6b4ff6fb1ebc0b0e6b853dcfffd7a049e (diff)
downloadpuppet-reprepro-5d92c6169661a5833bdc73df738e1a6a36840f23.tar.gz
puppet-reprepro-5d92c6169661a5833bdc73df738e1a6a36840f23.tar.bz2
Checking if there's a key to export
-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 e547408..ecd2cf2 100644
--- a/templates/reprepro-export-key.sh.erb
+++ b/templates/reprepro-export-key.sh.erb
@@ -1,4 +1,7 @@
#!/bin/bash
KEY="`/usr/bin/gpg --with-colon --list-secret-keys | cut -d : -f 5 | head -1`"
-/usr/bin/gpg --export -a $KEY > <%= basedir %>/key.asc
+
+if [ ! -z "$KEY" ]; then
+ /usr/bin/gpg --export --armor $KEY > <%= basedir %>/key.asc
+fi