1.1 --- a/tools/init_user.sh Thu Mar 10 01:43:31 2016 +0100
1.2 +++ b/tools/init_user.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 @@ -29,10 +31,18 @@
1.18 WEB_INSTALL_DIR=${3:-$WEB_INSTALL_DIR}
1.19 USER=${4:-$IMIP_AGENT_USER}
1.20
1.21 -for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static \
1.22 - "$INSTALL_DIR"/journal ; do
1.23 +for DIR in "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do
1.24 mkdir -p "$DIR/$CALENDAR_USER"
1.25 chown "$USER" "$DIR/$CALENDAR_USER"
1.26 chmod g+ws "$DIR/$CALENDAR_USER"
1.27 # Group privileges should already be set.
1.28 done
1.29 +
1.30 +if [ "$STORE_TYPE" = "file" ]; then
1.31 + for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/journal ; do
1.32 + mkdir -p "$DIR/$CALENDAR_USER"
1.33 + chown "$USER" "$DIR/$CALENDAR_USER"
1.34 + chmod g+ws "$DIR/$CALENDAR_USER"
1.35 + # Group privileges should already be set.
1.36 + done
1.37 +fi