summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-02-13 11:07:44 -0500
committerMicah Anderson <micah@riseup.net>2013-02-13 11:07:44 -0500
commitcc12ced0f3f62c975f9f711da67770ffb33d7ba7 (patch)
treebbde5c6f5a2df2da3e97780f04c45407dda49a5a /files
parentd49d2ef054bb1764aa3d374870d6d6557b3234e3 (diff)
parentef40c3b4c8f7e9405397ccf8ca3f9fb8ace22328 (diff)
Merge remote-tracking branch 'koumbit/multi_repo_support'
Diffstat (limited to 'files')
-rw-r--r--files/reprepro-export-key.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/files/reprepro-export-key.sh b/files/reprepro-export-key.sh
new file mode 100644
index 0000000..6e0b278
--- /dev/null
+++ b/files/reprepro-export-key.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# This file is managed by Puppet. Do not edit, any changes will be overwritten!
+#
+
+set -e
+
+BASEDIR="$1"
+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