#! /bin/sh


if [[ $# -ne 1 ]] ;
    then echo "Usage:  set_dirs <APACHE_GROUP> where <APACHE GROUP> is the group the apache process is running as." 1>&2; exit 1
fi



echo
echo "Setting up ../sbin and ../bin"
echo
mkdir -p ../bin
mkdir -p ../sbin
chgrp -R $1 ../bin ../sbin
chmod -R 750  ../bin ../sbin
echo
echo "Setting up ../tmp"
echo
mkdir -p ../tmp
chgrp -R $1 ../tmp
chmod -R 770 ../tmp
echo "Setting up ../templates"
echo
mkdir -p ../templates
chgrp -R $1 ../templates
chmod -R 770 ../templates
echo
echo "Setting up ../clipboards"
echo
mkdir -p ../clipboards
chgrp -R $1 ../clipboards
chmod -R 770 ../clipboards
echo
echo "Setting up ../surveys"
echo
mkdir -p ../surveys
chgrp -R $1 ../surveys
chmod -R 770 ../surveys
echo
echo "Setting up ../images"
echo
mkdir -p ../images
chgrp -R $1 ../images
chmod -R 770 ../images
echo "Setting up ../chat"
echo
mkdir -p ../chat
chgrp -R $1 ../chat
chmod -R 770 ../chat
echo
echo "Setting up ../auto_update"
echo
mkdir -p ../auto_update
mkdir -p ../auto_update/rosters
mkdir -p ../auto_update/request
mkdir -p ../auto_update/logs
chgrp -R $1 ../auto_update
chmod -R 770 ../auto_update
echo
echo
echo "Setting up ../courses"
echo
mkdir -p ../courses
chgrp -R $1 ../courses
chmod -R 770 ../courses
echo
echo "Setting up ../users"
echo
mkdir -p ../users
mkdir -p ../users/admin
mkdir -p ../users/keys
mkdir -p ../users/logs
chgrp -R $1 ../users
chmod -R 770 ../users
echo
