#! /bin/sh # # This file is included by the quickstart script file "bwinstall" so that it can live # within the svn repository. # errorMsg() { echo "*******************************************************" echo "Error: $1" echo "*******************************************************" exit 1 } if [ -z "$JAVA_HOME" -o ! -d "$JAVA_HOME" ] ; then errorMsg "JAVA_HOME is not defined correctly for bedework." fi # Ant ANT_HOME=`dirname "$PRG"`/apache-ant-1.7.0 ANT_HOME=`cd "$ANT_HOME" && pwd` saveddir=`pwd` export QUICKSTART_HOME=$saveddir # Directory server export DS_HOME=$QUICKSTART_HOME/apacheds-1.5.3-fixed # ------------- Should not need to change anything below this ---------- ANT=$ANT_HOME/bin/ant export BEDEWORK_HOME=$QUICKSTART_HOME/bedework libcache=$BEDEWORK_HOME/libcache quickStartBuildFile=$QUICKSTART_HOME/build.xml qsant="$ANT -buildfile $quickStartBuildFile" ANT_CLASSPATH=$ANT_HOME/lib/ant-launcher.jar qsantrunner="$JAVA_HOME/bin/java -classpath $ANT_HOME/lib/ant-launcher.jar -Dant.home=$ANT_HOME" ant_class_def="org.apache.tools.ant.launch.Launcher" shutdownServer() { echo "Stopping directory server" $JAVA_HOME/bin/java -jar $DS_HOME/bin/apacheds-tools.jar graceful --install-path $DS_HOME --configuration } readVal() { val= until [ "$val" != "" ] ; do echo "Enter $1" read val done } echo "========================================================" echo "This script will create a set of configurations in your " echo "home directory ($HOME) for you to customize" echo "In addition we create an initial set of users and groups" echo "which allow an initial system to run" echo "" echo "Further changes can then be made to the running quickstart" echo "using the tools provided" echo "" echo "The following information will be requested:" echo " One or more administrative group names" echo " One or more administrative users" echo " One or more non-administrative users" echo "" echo "The ldap directory will be initialised with this information" echo "then you will provide the account which will be made superuser" echo "which must be one of those supplied above." echo "========================================================" # Ensure we shut down the directory server at program termination # or after we received a signal: trap 'shutdownServer' 0 trap "exit 2" 1 2 3 15 #XXif [ -d "$HOME/bwbuild" ] ; then #XX echo "========================================================" #XX echo "You already have a bwbuild in user home $HOME" #XX echo "Enter 'yes' to continue with the directory unchanged" #XX echo "(you may need to update it afterwards)" #XX echo "Enter anything else to terminate the install allowing " #XX echo "you to rename or destroy it." #XX echo "========================================================" #XX #XX echo "Continue? yes/no" #XX read reply #XX #XX if [ "$reply" != "yes" ] ; then #XX exit 1 #XX fi #XXelse #XX cp $BEDEWORK_HOME/config/bwbuild $USER_HOME #XXfi $qsant install-configs echo "========================================================" echo "We need to create a new ldap directory for the quickstart" # echo "========================================================" echo "Starting directory server" export DS_OPTS="-Dapacheds.log.dir=$DS_HOME/logs" cd $DS_HOME && ./apacheds.sh & echo "Pausing while the server starts" sleep 10 $qsant initDirForQuickstart echo "Now we invoke the adduser script to add a superuser to the system" echo "We need to know the account, first name, last name, the calendar address" echo "(email address) and a password" readVal "account" rootAccount=$val adduser_defs="-Dorg.bedework.directory.account=$val" readVal "firstname" adduser_defs="$adduser_defs -Dorg.bedework.directory.firstname=$val" readVal "lastname" adduser_defs="$adduser_defs -Dorg.bedework.directory.lastname=$val" readVal "calendar address (email)" adduser_defs="$adduser_defs -Dorg.bedework.directory.caladdr=$val" readVal "password" adduser_defs="$adduser_defs -Dorg.bedework.directory.password=$val" $qsantrunner $adduser_defs $ant_class_def addUser # # Now unzip the dump/restore package and run it to initialise the system # cd $BEDEWORK_HOME/dist rm -r temp mkdir temp cd temp unzip ../dumpres.zip cd dumpres chmod +x bwrun cd $QUICKSTART_HOME $qsantrunner "-Dorg.bedework.newsys.rootid=$rootAccount" $ant_class_def create-newsys