summaryrefslogtreecommitdiff
path: root/templates/reprepro-export-key.sh.erb
blob: e619e24155a6084c2c0c12c2cce43f98c988a7af (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/bash

KEY="`gpg --homedir <%= basedir %>/.gnupg --with-colon --list-secret-keys | cut -d : -f 5 | head -n 1`"

if [ ! -z "$KEY" ]; then
  tempfile=$(mktemp)
  gpg --homedir <%= basedir %>/.gnupg --export --armor $KEY > "$tempfile"
  mv "$tempfile" <%= basedir %>/key.asc
  chmod 0664 <%= basedir %>/key.asc
fi