1.1 --- a/tools/init_user.sh Tue Apr 19 23:44:33 2016 +0200
1.2 +++ b/tools/init_user.sh Wed Apr 20 16:13:29 2016 +0200
1.3 @@ -27,6 +27,10 @@
1.4 The resources will be defined as having $IMIP_AGENT_USER as owner.
1.5
1.6 See $CONFIG for the settings used as described above.
1.7 +
1.8 +Example:
1.9 +
1.10 +$PROGNAME mailto:vincent.vole@example.com
1.11 EOF
1.12 exit 1
1.13 fi
1.14 @@ -40,8 +44,20 @@
1.15 exit 1
1.16 fi
1.17
1.18 +# Test for a privileged user.
1.19 +
1.20 +if [ `whoami` != 'root' ]; then
1.21 + cat 1>&2 <<EOF
1.22 +You will need to become a privileged user using su or sudo to run this program
1.23 +because it changes file ownership.
1.24 +EOF
1.25 + exit 1
1.26 +fi
1.27 +
1.28 # Initialise the directories.
1.29
1.30 +echo "Creating preferences and static Web directories..." 1>&2
1.31 +
1.32 for DIR in "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do
1.33 mkdir -p "$DIR/$CALENDAR_USER"
1.34 chown "$IMIP_AGENT_USER" "$DIR/$CALENDAR_USER"
1.35 @@ -50,6 +66,9 @@
1.36 done
1.37
1.38 if [ "$STORE_TYPE" = "file" ]; then
1.39 +
1.40 + echo "Creating store and journal directories..." 1>&2
1.41 +
1.42 for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/journal ; do
1.43 mkdir -p "$DIR/$CALENDAR_USER"
1.44 chown "$IMIP_AGENT_USER" "$DIR/$CALENDAR_USER"