# HG changeset patch # User Paul Boddie # Date 1442612756 -7200 # Node ID 0832ebaf5f61632e435ecefe627ca878f3372325 # Parent 67dfe17b2f9d4829c862d5ef0439808dcfa71a1b Added a script that initialises user directories. Changed the installation script to install various tools. diff -r 67dfe17b2f9d -r 0832ebaf5f61 tools/init_user.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/init_user.sh Fri Sep 18 23:45:56 2015 +0200 @@ -0,0 +1,31 @@ +#!/bin/sh + +PROGNAME=`basename $0` + +DEFAULT_USER=imip-agent +DEFAULT_INSTALL_DIR=/var/lib/imip-agent +DEFAULT_WEB_INSTALL_DIR=/var/www/imip-agent + +if [ "$1" = "--help" ]; then + cat 1>&2 < [ [ [ ] ] ] + +Initialise a given calendar user within an existing installation, using the +given system user for ownership and the installation's stored data and published +data directories (or, respectively, $DEFAULT_USER, $DEFAULT_INSTALL_DIR and +$DEFAULT_WEB_INSTALL_DIR if omitted). +EOF + exit 1 +fi + +CALENDAR_USER=${1:-$DEFAULT_CALENDAR_USER} +USER=${2:-$DEFAULT_USER} +INSTALL_DIR=${3:-$DEFAULT_INSTALL_DIR} +WEB_INSTALL_DIR=${4:-$DEFAULT_WEB_INSTALL_DIR} + +for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do + mkdir -p "$DIR/$CALENDAR_USER" + chown "$USER" "$DIR/$CALENDAR_USER" + chmod g+ws "$DIR/$CALENDAR_USER" + # Group privileges should already be set. +done diff -r 67dfe17b2f9d -r 0832ebaf5f61 tools/install.sh --- a/tools/install.sh Fri Sep 18 23:44:36 2015 +0200 +++ b/tools/install.sh Fri Sep 18 23:45:56 2015 +0200 @@ -51,11 +51,15 @@ # Tools +TOOLS="fix.sh init.sh init_user.sh make_freebusy.py" + if [ ! -e "$INSTALL_DIR/tools" ]; then mkdir -p "$INSTALL_DIR/tools" fi -cp tools/make_freebusy.py "$INSTALL_DIR/tools/" +for TOOL in $TOOLS; do + cp "tools/$TOOL" "$INSTALL_DIR/tools/" +done # Web manager interface.