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