imip-agent

tools/init.sh

1059:861e86e687af
2016-02-09 Paul Boddie Changed the recording of reservations for quotas to use free/busy records.
     1 #!/bin/sh     2      3 DIRNAME=`dirname $0`     4      5 if [ -e "$DIRNAME/config.sh" ]; then     6     . "$DIRNAME/config.sh"     7 else     8     . /etc/imip-agent/config.sh     9 fi    10     11 PROGNAME=`basename $0`    12     13 if [ "$1" = "--help" ]; then    14     cat 1>&2 <<EOF    15 Usage: $PROGNAME [ <stored data directory> [ <published data directory> [ <user> [ <group> ] ] ] ]    16     17 Initialise stored and published data directories either at any specified    18 locations or, respectively, at $INSTALL_DIR and $WEB_INSTALL_DIR.    19     20 Set permissions to the given user and group or, respectively, to $IMIP_AGENT_USER    21 and $IMIP_AGENT_GROUP.    22     23 Within the stored data directory (using $INSTALL_DIR as an example), the    24 following directories are created:    25     26   * $INSTALL_DIR/journal    27   * $INSTALL_DIR/preferences    28   * $INSTALL_DIR/store    29     30 Within the published data directory (using $WEB_INSTALL_DIR as an example), the    31 following directory is created:    32     33   * $WEB_INSTALL_DIR/static    34 EOF    35     exit 1    36 fi    37     38 INSTALL_DIR=${1:-$INSTALL_DIR}    39 WEB_INSTALL_DIR=${2:-$WEB_INSTALL_DIR}    40 USER=${3:-$IMIP_AGENT_USER}    41 GROUP=${4:-$IMIP_AGENT_GROUP}    42     43 for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static \    44            "$INSTALL_DIR"/journal ; do    45     mkdir -p "$DIR"    46     chown "$USER" "$DIR"    47     chgrp "$GROUP" "$DIR"    48     chmod g+ws "$DIR"    49 done