1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tools/init_user.sh Fri Sep 18 23:45:56 2015 +0200
1.3 @@ -0,0 +1,31 @@
1.4 +#!/bin/sh
1.5 +
1.6 +PROGNAME=`basename $0`
1.7 +
1.8 +DEFAULT_USER=imip-agent
1.9 +DEFAULT_INSTALL_DIR=/var/lib/imip-agent
1.10 +DEFAULT_WEB_INSTALL_DIR=/var/www/imip-agent
1.11 +
1.12 +if [ "$1" = "--help" ]; then
1.13 + cat 1>&2 <<EOF
1.14 +Usage: $PROGNAME <calendar user> [ <user> [ <stored data directory> [ <published data directory> ] ] ]
1.15 +
1.16 +Initialise a given calendar user within an existing installation, using the
1.17 +given system user for ownership and the installation's stored data and published
1.18 +data directories (or, respectively, $DEFAULT_USER, $DEFAULT_INSTALL_DIR and
1.19 +$DEFAULT_WEB_INSTALL_DIR if omitted).
1.20 +EOF
1.21 + exit 1
1.22 +fi
1.23 +
1.24 +CALENDAR_USER=${1:-$DEFAULT_CALENDAR_USER}
1.25 +USER=${2:-$DEFAULT_USER}
1.26 +INSTALL_DIR=${3:-$DEFAULT_INSTALL_DIR}
1.27 +WEB_INSTALL_DIR=${4:-$DEFAULT_WEB_INSTALL_DIR}
1.28 +
1.29 +for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do
1.30 + mkdir -p "$DIR/$CALENDAR_USER"
1.31 + chown "$USER" "$DIR/$CALENDAR_USER"
1.32 + chmod g+ws "$DIR/$CALENDAR_USER"
1.33 + # Group privileges should already be set.
1.34 +done
2.1 --- a/tools/install.sh Fri Sep 18 23:44:36 2015 +0200
2.2 +++ b/tools/install.sh Fri Sep 18 23:45:56 2015 +0200
2.3 @@ -51,11 +51,15 @@
2.4
2.5 # Tools
2.6
2.7 +TOOLS="fix.sh init.sh init_user.sh make_freebusy.py"
2.8 +
2.9 if [ ! -e "$INSTALL_DIR/tools" ]; then
2.10 mkdir -p "$INSTALL_DIR/tools"
2.11 fi
2.12
2.13 -cp tools/make_freebusy.py "$INSTALL_DIR/tools/"
2.14 +for TOOL in $TOOLS; do
2.15 + cp "tools/$TOOL" "$INSTALL_DIR/tools/"
2.16 +done
2.17
2.18 # Web manager interface.
2.19