1 #!/bin/sh 2 3 DIRNAME=`dirname "$0"` 4 5 if [ -e "$DIRNAME/config.sh" ]; then 6 CONFIG="$DIRNAME/config.sh" 7 . "$CONFIG" 8 else 9 CONFIG=/etc/imip-agent/config.sh 10 . "$CONFIG" 11 fi 12 13 PROGNAME=`basename "$0"` 14 15 if [ "$1" = "--help" ]; then 16 cat 1>&2 <<EOF 17 Usage: $PROGNAME 18 19 Fix permissions for the stored and published data directories, operating on... 20 21 * $INSTALL_DIR 22 * $WEB_INSTALL_DIR 23 24 ...respectively. 25 26 Set ownership and membership to the user and group respectively given as 27 $IMIP_AGENT_USER and $IMIP_AGENT_GROUP. 28 EOF 29 exit 1 30 fi 31 32 chown -R "$IMIP_AGENT_USER" "$INSTALL_DIR" 33 chgrp -R "$IMIP_AGENT_GROUP" "$INSTALL_DIR" 34 35 for DIR in "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do 36 chown -R "$IMIP_AGENT_USER" "$DIR" 37 chgrp -R "$IMIP_AGENT_GROUP" "$DIR" 38 chmod -R g+w "$DIR" 39 done 40 41 if [ "$STORE_TYPE" = "file" ]; then 42 for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/journal ; do 43 chown -R "$IMIP_AGENT_USER" "$DIR" 44 chgrp -R "$IMIP_AGENT_GROUP" "$DIR" 45 chmod -R g+w "$DIR" 46 done 47 fi