1.1 --- a/tools/init_user.sh Sun Apr 03 21:41:44 2016 +0200
1.2 +++ b/tools/init_user.sh Sun Apr 03 21:43:35 2016 +0200
1.3 @@ -14,26 +14,37 @@
1.4
1.5 if [ "$1" = "--help" ]; then
1.6 cat 1>&2 <<EOF
1.7 -Usage: $PROGNAME <calendar user> [ <stored data directory> [ <published data directory> [ <user> ] ] ]
1.8 +Usage: $PROGNAME <calendar user>
1.9
1.10 Initialise a given calendar user within an existing installation, creating
1.11 -resources within the given stored data and published data directories or,
1.12 -respectively, within $INSTALL_DIR and $WEB_INSTALL_DIR.
1.13 +resources within the given stored data and published data directories...
1.14 +
1.15 + * $INSTALL_DIR
1.16 + * $WEB_INSTALL_DIR
1.17
1.18 -The resources will be defined as having the given system user as owner or,
1.19 -if the user is omitted, the $IMIP_AGENT_USER as owner.
1.20 +...respectively.
1.21 +
1.22 +The resources will be defined as having $IMIP_AGENT_USER as owner.
1.23 +
1.24 +See $CONFIG for the settings used as described above.
1.25 EOF
1.26 exit 1
1.27 fi
1.28
1.29 CALENDAR_USER=$1
1.30 -INSTALL_DIR=${2:-$INSTALL_DIR}
1.31 -WEB_INSTALL_DIR=${3:-$WEB_INSTALL_DIR}
1.32 -USER=${4:-$IMIP_AGENT_USER}
1.33 +
1.34 +if [ ! "$CALENDAR_USER" ]; then
1.35 + cat 1>&2 <<EOF
1.36 +Need a calendar user to initialise.
1.37 +EOF
1.38 + exit 1
1.39 +fi
1.40 +
1.41 +# Initialise the directories.
1.42
1.43 for DIR in "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do
1.44 mkdir -p "$DIR/$CALENDAR_USER"
1.45 - chown "$USER" "$DIR/$CALENDAR_USER"
1.46 + chown "$IMIP_AGENT_USER" "$DIR/$CALENDAR_USER"
1.47 chmod g+ws "$DIR/$CALENDAR_USER"
1.48 # Group privileges should already be set.
1.49 done
1.50 @@ -41,7 +52,7 @@
1.51 if [ "$STORE_TYPE" = "file" ]; then
1.52 for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/journal ; do
1.53 mkdir -p "$DIR/$CALENDAR_USER"
1.54 - chown "$USER" "$DIR/$CALENDAR_USER"
1.55 + chown "$IMIP_AGENT_USER" "$DIR/$CALENDAR_USER"
1.56 chmod g+ws "$DIR/$CALENDAR_USER"
1.57 # Group privileges should already be set.
1.58 done