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

/usr/bin/gpg --homedir <%= basedir %>/.gnupg --with-colon --list-secret-keys | /usr/bin/cut -d : -f 5 | /usr/bin/head -1 &> <%= basedir %>/key.log

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

if [ ! -z "$KEY" ]; then
  /usr/bin/gpg --export --armor $KEY > <%= basedir %>/key.asc
fi