1.1 --- a/tools/init.sh Thu Mar 10 01:43:31 2016 +0100
1.2 +++ b/tools/init.sh Fri Mar 11 01:33:45 2016 +0100
1.3 @@ -3,9 +3,11 @@
1.4 DIRNAME=`dirname $0`
1.5
1.6 if [ -e "$DIRNAME/config.sh" ]; then
1.7 - . "$DIRNAME/config.sh"
1.8 + CONFIG="$DIRNAME/config.sh"
1.9 + . "$CONFIG"
1.10 else
1.11 - . /etc/imip-agent/config.sh
1.12 + CONFIG=/etc/imip-agent/config.sh
1.13 + . "$CONFIG"
1.14 fi
1.15
1.16 PROGNAME=`basename $0`
1.17 @@ -23,14 +25,16 @@
1.18 Within the stored data directory (using $INSTALL_DIR as an example), the
1.19 following directories are created:
1.20
1.21 - * $INSTALL_DIR/journal
1.22 + * $INSTALL_DIR/journal (if STORE_TYPE is "file")
1.23 * $INSTALL_DIR/preferences
1.24 - * $INSTALL_DIR/store
1.25 + * $INSTALL_DIR/store (if STORE_TYPE is "file")
1.26
1.27 Within the published data directory (using $WEB_INSTALL_DIR as an example), the
1.28 following directory is created:
1.29
1.30 * $WEB_INSTALL_DIR/static
1.31 +
1.32 +See $CONFIG for the STORE_TYPE setting.
1.33 EOF
1.34 exit 1
1.35 fi
1.36 @@ -40,10 +44,18 @@
1.37 USER=${3:-$IMIP_AGENT_USER}
1.38 GROUP=${4:-$IMIP_AGENT_GROUP}
1.39
1.40 -for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static \
1.41 - "$INSTALL_DIR"/journal ; do
1.42 +for DIR in "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do
1.43 mkdir -p "$DIR"
1.44 chown "$USER" "$DIR"
1.45 chgrp "$GROUP" "$DIR"
1.46 chmod g+ws "$DIR"
1.47 done
1.48 +
1.49 +if [ "$STORE_TYPE" = "file" ]; then
1.50 + for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/journal ; do
1.51 + mkdir -p "$DIR"
1.52 + chown "$USER" "$DIR"
1.53 + chgrp "$GROUP" "$DIR"
1.54 + chmod g+ws "$DIR"
1.55 + done
1.56 +fi