Files
php-web-doc/scripts/set_ownership.sh
Vincent Gevers 076c45dfe3 Make sure ownership is set
auth() shouldn't be in the template..
2005-07-31 15:56:11 +00:00

39 lines
907 B
Bash
Executable File

#!/bin/sh
# get paths
. `dirname $0`/../build-ops
if [ `whoami` = 'root' ]
then
if [ ! -d $FILESDIR ]
then
echo "Making files dir: $FILESDIR"
mkdir $FILESDIR
fi
echo "Setting ownership of files dir ($FILESDIR) to $WWWUSER.$WWWGROUP"
chown -R $WWWUSER $FILESDIR
chgrp -R $WWWGROUP $FILESDIR
if [ ! -d $SQLITEDIR ]
then
echo "Making SQLite dir: $SQLITEDIR"
mkdir $SQLITEDIR
fi
echo "Setting ownership of SQLite dir ($SQLITEDIR) to $WWWUSER.$WWWGROUP"
chown -R $WWWUSER $SQLITEDIR
chgrp -R $WWWGROUP $SQLITEDIR
if [ ! -d $DOCWEB/www/images/users ]
then
echo "Making files dir: $DOCWEB/www/images/users"
mkdir $FILESDIR
fi
echo "Setting ownership of files dir ($DOCWEB/www/images/users) to $WWWUSER.$WWWGROUP"
chown -R $WWWUSER $DOCWEB/www/images/users
chgrp -R $WWWGROUP $DOCWEB/www/images/users
echo "Done."
else
echo "Must be root."
fi