/[adm]/puppet/modules/gnupg/templates/create_gnupg_keys.sh
ViewVC logotype

Contents of /puppet/modules/gnupg/templates/create_gnupg_keys.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 941 - (show annotations) (download) (as text)
Wed Feb 2 18:11:34 2011 UTC (13 years, 1 month ago) by boklm
File MIME type: application/x-sh
File size: 367 byte(s)
- allow selecting keyring directory and user
- make it possible to generate multiple keys in the same keyring


1 #!/bin/bash
2
3 BATCHFILE="$1"
4 HOMEDIR="$2"
5 LOCK="$3"
6
7 test $# -eq 3 || exit 1
8
9 if [ -e "$LOCK" ]
10 then
11 echo "Lock file already exist." 1>&2
12 echo "Remove $LOCK if you want to regenerate key." 1>&2
13 exit 2
14 fi
15
16 touch "$LOCK"
17
18 /sbin/rngd -f -r /dev/urandom &
19 RAND=$!
20 cd $HOMEDIR
21 gpg --homedir $HOMEDIR --batch --gen-key $BATCHFILE
22 EXIT=$?
23
24 kill $RAND
25
26 exit $EXIT

  ViewVC Help
Powered by ViewVC 1.1.30