]> gitweb.fluxo.info Git - puppet-reprepro.git/commitdiff
Checking if there's a key to export
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 9 May 2010 03:47:38 +0000 (00:47 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 9 May 2010 03:47:38 +0000 (00:47 -0300)
templates/reprepro-export-key.sh.erb

index e547408722c60e255050ce509b861eb8bf4ddaae..ecd2cf2768be3da5609c21bc7447dc3c47176d88 100644 (file)
@@ -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