diff options
author | Micah Anderson <micah@riseup.net> | 2013-02-06 14:07:17 -0500 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2013-02-06 14:07:17 -0500 |
commit | ce1ebea7cc3911ebac616a8a065a484b9452e72b (patch) | |
tree | aab52e2f06ae31b39a34d59b5432311f30a22911 /templates/reprepro-export-key.sh.erb | |
parent | 31a7ed2a84d909215f1f12ed2bb78bb5fe28bbcd (diff) | |
parent | 50075192d8827d7fa8721ffb6847fedbb4a99c60 (diff) |
Merge branch 'master' into leap
There were merge conflicts with this merge, but I deliberately
merged with '-s recursive -X theirs' to take the shared modules
version of the changes.
We had some changes that we made, that I will incorporate as
separate commits on top of shared
Diffstat (limited to 'templates/reprepro-export-key.sh.erb')
-rw-r--r-- | templates/reprepro-export-key.sh.erb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/templates/reprepro-export-key.sh.erb b/templates/reprepro-export-key.sh.erb index c99f06b..bbc195c 100644 --- a/templates/reprepro-export-key.sh.erb +++ b/templates/reprepro-export-key.sh.erb @@ -1,7 +1,18 @@ -#!/bin/bash +#!/bin/sh +# +# This file is managed by Puppet. Do not edit, any changes will be overwritten! +# -KEY="`gpg --homedir <%= basedir %>/.gnupg --with-colon --list-secret-keys | cut -d : -f 5 | head -n 1`" +set -e -if [ ! -z "$KEY" ]; then - gpg --homedir <%= basedir %>/.gnupg --export --armor $KEY > <%= basedir %>/key.asc +KEY="$(gpg --homedir '<%= @basedir %>/.gnupg' --with-colon --list-secret-keys | cut -d : -f 5 | head -n 1)" + +if [ -n "$KEY" ]; then + TEMPFILE=$(mktemp --tmpdir='<%= @basedir %>') + trap "rm -f '$TEMPFILE'" EXIT + DESTFILE='<%= @basedir %>/key.asc' + gpg --homedir '<%= @basedir %>/.gnupg' --export --armor "$KEY" > "$TEMPFILE" + mv "$TEMPFILE" "$DESTFILE" + chown reprepro:reprepro "$DESTFILE" + chmod 0664 "$DESTFILE" fi |