3 # OpenXPKI (Re)configuration script
5 # Written by Martin Bartosch for the OpenXPKI project 2006
6 # Copyright (c) 2006 by The OpenXPKI Project
9 prefix
="[% dir.prefix %]"
10 exec_prefix
="[% dir.exec_prefix %]"
11 TEMPLATEDIR
="[% dir.templatedir %]"
13 SYSCONFDIR
="[% dir.sysconfdir %]"
14 OPENXPKICONFDIR
="[% dir.openxpkiconfdir %]"
22 # interactively create initial configuration
23 $CFG --sectionsmenu --interactive --force --writecfg $OPENXPKICONFDIR/openxpki.conf
29 echo "* Creating configuration files in $OPENXPKICONFDIR"
30 for xmlfile
in $
* ; do
31 basename=`basename $xmlfile`
32 echo -n "$basename... "
33 $CFG --file $xmlfile $FORCE --dstdir $OPENXPKICONFDIR
38 echo "*** Configuration incomplete (and probably broken)."
39 echo "*** Please correct the problem and repeat."
45 # if no arguments are given this function only checks if the required
46 # directories are present. otherwise these directories are also created
49 echo "* Checking directories"
51 for entry
in openxpkistatedir openxpkisessiondir dataexchange tmpdir
; do
52 dir
="`$CFG --getcfg dir.$entry`"
54 if [ -d "$dir" ] ; then
57 if [ "$1" != "" ] ; then
58 if [ "`uname`" == "SunOS" ]; then
59 INSTALL
="/usr/sbin/install -u";
63 if $INSTALL $RUNUSER -g $RUNGROUP -m 0750 -d $dir ; then
66 echo "$dir: FAILED TO CREATE"
70 echo "$dir: DOES NOT EXIST"
79 ###########################################################################
81 echo "OpenXPKI (Re)configuration Script"
82 echo "Copyright (c) 2006 by The OpenXPKI Project"
85 while [ -n "$1" ] ; do
88 pod2man
$0 | nroff
-man -Tascii
92 echo "Entering batch mode..."
112 echo "Additional options to openxpki-metaconf: '$METACONF_OPTS'"
116 echo "Usage: $0 OPTIONS"
118 echo " --batch Noninteractively reconfigure XML files from openxpki.conf"
124 for DIR
in /etc
/openxpki
/usr
/local
/etc
/openxpki
"$OPENXPKICONFDIR" "`pwd`/etc/openxpki" "`pwd`"; do
125 if [ -e "$DIR/openxpki.conf" ]; then
126 OPENXPKICONFDIR
="$DIR"
130 CFG
="openxpki-metaconf --config $OPENXPKICONFDIR/openxpki.conf $METACONF_OPTS"
132 echo "Configuring in $OPENXPKICONFDIR..."
134 if [ "$INTERACTIVE" = "1" ] ; then
135 if ! reconfigure
; then
141 XMLSTYLE
="`$CFG --getcfg deployment.xmlstyle`"
142 RUNUSER
="`$CFG --getcfg server.runuser`"
143 RUNGROUP
="`$CFG --getcfg server.rungroup`"
145 FILES
="$TEMPLATEDIR/$TEMPLATE/log.conf"
149 echo "Creating configuration (multiple XML files)..."
150 FILES
="$FILES `ls $TEMPLATEDIR/$TEMPLATE/*.xml`"
153 echo "Creating configuration (single XML file)..."
154 FILES
="$FILES $TEMPLATEDIR/$TEMPLATE/config.xml"
157 echo "Illegal deployment mode $XMLSTYLE"
164 if ! check_dirs
$CREATE_DIRS ; then
166 echo "One or more required directories do not exist. Please inspect the above"
167 echo "error output and either create the missing directories or run"
169 echo "$0 [OPTIONS] --createdirs"
171 echo "to automatically create them."
177 echo "OpenXPKI instance configured successfully."
183 ###########################################################################
187 openxpki-configure - Create OpenXPKI config files from meta-configuration.
191 openxpki-configure [OPTIONS]
194 --help display this help text and exit
195 --batch non-interactive configuration
196 --force overwrite existing files
197 --template specify template (default: default)
198 --createdirs create missing directories
199 -- args following -- are literally passed to openxpki-metaconf
201 This script generates the OpenXPKI configuration files from a set of
202 templates (taken from $TEMPLATEDIR)
203 by filling in values specified in the OpenXPKI meta configuration
204 $OPENXPKICONFDIR/openxpki.conf.
206 Please note that this meta configuration is intended for getting
207 OpenXPKI up and running quickly. Beyond basic configuration there
208 are many configuration parameters that cannot be set by this approach.
210 (For a more advanced setup may be advisable to modify the settings in
211 OpenXPKI's XML configuration files directly and NOT use openxpki-configure.)