| 1 |
#! /bin/sh |
|---|
| 2 |
|
|---|
| 3 |
# |
|---|
| 4 |
# This file is included by the quickstart script file "bwinstall" so that it can live |
|---|
| 5 |
# within the svn repository. |
|---|
| 6 |
# |
|---|
| 7 |
|
|---|
| 8 |
ANT_HOME=`dirname "$PRG"`/apache-ant-1.7.0 |
|---|
| 9 |
ANT_HOME=`cd "$ANT_HOME" && pwd` |
|---|
| 10 |
saveddir=`pwd` |
|---|
| 11 |
|
|---|
| 12 |
export QUICKSTART_HOME=$saveddir |
|---|
| 13 |
|
|---|
| 14 |
export BEDEWORK_HOME=$QUICKSTART_HOME/bedework |
|---|
| 15 |
|
|---|
| 16 |
libcache=$BEDEWORK_HOME/libcache |
|---|
| 17 |
|
|---|
| 18 |
export DS_HOME=$QUICKSTART_HOME/apacheds-1.5.3-fixed |
|---|
| 19 |
|
|---|
| 20 |
shutdownServer() { |
|---|
| 21 |
echo "Stopping directory server" |
|---|
| 22 |
$JAVA_HOME/bin/java -jar $DS_HOME/bin/apacheds-tools.jar graceful --install-path $DS_HOME --configuration |
|---|
| 23 |
} |
|---|
| 24 |
|
|---|
| 25 |
echo "========================================================" |
|---|
| 26 |
echo "This script will create a set of configurations in your " |
|---|
| 27 |
echo "home directory ($HOME) for you to customize" |
|---|
| 28 |
echo "In addition we create an initial set of users and groups" |
|---|
| 29 |
echo "which allow an initial system to run" |
|---|
| 30 |
echo "" |
|---|
| 31 |
echo "Further changes can then be made to the running quickstart" |
|---|
| 32 |
echo "using the tools provided" |
|---|
| 33 |
echo "" |
|---|
| 34 |
echo "The following information will be requested:" |
|---|
| 35 |
echo " One or more administrative group names" |
|---|
| 36 |
echo " One or more administrative users" |
|---|
| 37 |
echo " One or more non-administrative users" |
|---|
| 38 |
echo "" |
|---|
| 39 |
echo "The ldap directory will be initialised with this information" |
|---|
| 40 |
echo "then you will provide the account which will be made superuser" |
|---|
| 41 |
echo "which must be one of those supplied above." |
|---|
| 42 |
echo "========================================================" |
|---|
| 43 |
|
|---|
| 44 |
if [ -d "$HOME/bwbuild" ] ; then |
|---|
| 45 |
echo "========================================================" |
|---|
| 46 |
echo "You already have a bwbuild in user home $HOME" |
|---|
| 47 |
echo "Enter 'yes' to continue with the directory unchanged" |
|---|
| 48 |
echo "(you may need to update it afterwards)" |
|---|
| 49 |
echo "Enter anything else to terminate the install allowing " |
|---|
| 50 |
echo "you to rename or destroy it." |
|---|
| 51 |
echo "========================================================" |
|---|
| 52 |
|
|---|
| 53 |
echo "Continue? yes/no" |
|---|
| 54 |
read reply |
|---|
| 55 |
|
|---|
| 56 |
if [ "$reply" != "yes" ] ; then |
|---|
| 57 |
exit 1 |
|---|
| 58 |
fi |
|---|
| 59 |
else |
|---|
| 60 |
cp $BEDEWORK_HOME/config/bwbuild $USER_HOME |
|---|
| 61 |
fi |
|---|
| 62 |
|
|---|
| 63 |
# Ensure we shut down the directory server at program termination |
|---|
| 64 |
# or after we received a signal: |
|---|
| 65 |
trap 'shutdownServer' 0 |
|---|
| 66 |
trap "exit 2" 1 2 3 15 |
|---|
| 67 |
|
|---|
| 68 |
echo "========================================================" |
|---|
| 69 |
echo "We need to create a new ldap directory for the quickstart" |
|---|
| 70 |
# <!-- This after 3.5 |
|---|
| 71 |
# <echo message="or copy a previous quickstart ldap directory into the new quickstart" /> |
|---|
| 72 |
# --> |
|---|
| 73 |
echo "========================================================" |
|---|
| 74 |
|
|---|
| 75 |
echo "Starting directory server" |
|---|
| 76 |
|
|---|
| 77 |
export DS_OPTS="-Dapacheds.log.dir=$DS_HOME/logs" |
|---|
| 78 |
cd $DS_HOME && ./apacheds.sh & |
|---|
| 79 |
|
|---|
| 80 |
echo "Pausing while the server starts" |
|---|
| 81 |
|
|---|
| 82 |
sleep 10 |
|---|
| 83 |
|
|---|
| 84 |
echo "Getting directory information and creating entries" |
|---|
| 85 |
|
|---|
| 86 |
DIRTOOL_HOME=$BEDEWORK_HOME/projects/bwtools |
|---|
| 87 |
DIRTOOL_CP=$libcache/commons-codec-1.3.jar:$libcache/log4j-1.2.8.jar |
|---|
| 88 |
DIRTOOL_CP=$DIRTOOL_CP:$BEDEWORK_HOME/dist/bw-tools-3.5.jar |
|---|
| 89 |
|
|---|
| 90 |
$JAVA_HOME/bin/java -classpath $DIRTOOL_CP org.bedework.tools.directory.DirTool -initSystem |
|---|
| 91 |
|
|---|
| 92 |
echo "Enter superuser account" |
|---|
| 93 |
superuser= |
|---|
| 94 |
until [ "$superuser" != "" ] ; do |
|---|
| 95 |
read superuser |
|---|
| 96 |
done |
|---|
| 97 |
|
|---|
| 98 |
echo "create data" |
|---|