7 # Mark Huang <mlhuang@cs.princeton.edu>
8 # Copyright (C) 2006 The Trustees of Princeton University
10 # $Id: gpg,v 1.1 2006/04/06 21:51:59 mlhuang Exp $
13 # Source function library and configuration
14 . /etc/plc.d/functions
15 . /etc/planetlab/plc_config
19 # Generate GPG keyrings
20 if [ ! -f $PLC_ROOT_GPG_KEY_PUB -o ! -f $PLC_ROOT_GPG_KEY ] ; then
21 MESSAGE=$"Generating GPG keys"
24 mkdir -p $(dirname $PLC_ROOT_GPG_KEY_PUB)
25 mkdir -p $(dirname $PLC_ROOT_GPG_KEY)
27 # Temporarily replace /dev/random with /dev/urandom to
28 # avoid running out of entropy.
30 mknod /dev/random c 1 9
31 gpg --homedir=/root --batch --gen-key <<EOF
36 Name-Real: $PLC_NAME Central
37 Name-Comment: http://$PLC_WWW_HOST/
38 Name-Email: $PLC_MAIL_SUPPORT_ADDRESS
40 %pubring $PLC_ROOT_GPG_KEY_PUB
41 %secring $PLC_ROOT_GPG_KEY
46 mknod /dev/random c 1 8
47 chmod 600 $PLC_ROOT_GPG_KEY_PUB $PLC_ROOT_GPG_KEY