#!/bin/bash BASE_PATH=`pwd` WWW_PATH=$BASE_PATH/web PUB_BASE_PATH=${BASE_PATH/$USER/pub} FILES_DIRECTORY='userfiles' THUMBNAILS_DIRECTORY='thumbnails' ASSETS_DIRECTORY='assets' # thumbnails ... if [ -L "$BASE_PATH/web/$THUMBNAILS_DIRECTORY" ] ; then unlink $BASE_PATH/web/$THUMBNAILS_DIRECTORY fi if [ ! -d "$PUB_BASE_PATH/web/$THUMBNAILS_DIRECTORY" ] ; then mkdir -p $PUB_BASE_PATH/web/$THUMBNAILS_DIRECTORY find $PUB_BASE_PATH/web/$THUMBNAILS_DIRECTORY -type d -exec chmod 777 {} \; find $PUB_BASE_PATH/web/$THUMBNAILS_DIRECTORY -type f -exec chmod 666 {} \; fi if [ ! -f $PUB_BASE_PATH/web/$THUMBNAILS_DIRECTORY/.htaccess ] ; then echo 'Options -Indexes' > $PUB_BASE_PATH/web/$THUMBNAILS_DIRECTORY/.htaccess fi ln -sT $PUB_BASE_PATH/web/$THUMBNAILS_DIRECTORY $BASE_PATH/web/$THUMBNAILS_DIRECTORY # ... thumbnails # userfiles ... if [ -L "$BASE_PATH/web/$FILES_DIRECTORY" ] ; then unlink $BASE_PATH/web/$FILES_DIRECTORY fi if [ ! -d "$PUB_BASE_PATH/web/$FILES_DIRECTORY" ] ; then mkdir -p $PUB_BASE_PATH/web/$FILES_DIRECTORY find $PUB_BASE_PATH/web/$FILES_DIRECTORY -type d -exec chmod 777 {} \; find $PUB_BASE_PATH/web/$FILES_DIRECTORY -type f -exec chmod 666 {} \; fi if [ ! -f $PUB_BASE_PATH/web/$FILES_DIRECTORY/.htaccess ] ; then echo 'Options -Indexes' > $PUB_BASE_PATH/web/$FILES_DIRECTORY/.htaccess fi if [ ! -d "$PUB_BASE_PATH/web/$FILES_DIRECTORY/pano" ] ; then mkdir -p $PUB_BASE_PATH/web/$FILES_DIRECTORY/pano find $PUB_BASE_PATH/web/$FILES_DIRECTORY -type d -exec chmod 777 {} \; find $PUB_BASE_PATH/web/$FILES_DIRECTORY -type f -exec chmod 666 {} \; fi if [ ! -f $PUB_BASE_PATH/web/$FILES_DIRECTORY/pano/.htaccess ] ; then echo 'Options -Indexes' > $PUB_BASE_PATH/web/$FILES_DIRECTORY/pano/.htaccess echo 'DirectoryIndex index.html' >> $PUB_BASE_PATH/web/$FILES_DIRECTORY/pano/.htaccess fi ln -sT $PUB_BASE_PATH/web/$FILES_DIRECTORY $BASE_PATH/web/$FILES_DIRECTORY # ... userfiles # assets ... if [ -L "$BASE_PATH/web/$ASSETS_DIRECTORY" ] ; then unlink $BASE_PATH/web/$ASSETS_DIRECTORY fi if [ ! -d "$PUB_BASE_PATH/web/$ASSETS_DIRECTORY" ] ; then mkdir -p $PUB_BASE_PATH/web/$ASSETS_DIRECTORY echo 'Options -Indexes' > $PUB_BASE_PATH/web/$ASSETS_DIRECTORY/.htaccess find $PUB_BASE_PATH/web/$ASSETS_DIRECTORY -type d -exec chmod 777 {} \; find $PUB_BASE_PATH/web/$ASSETS_DIRECTORY -type f -exec chmod 666 {} \; fi ln -sT $PUB_BASE_PATH/web/$ASSETS_DIRECTORY $BASE_PATH/web/$ASSETS_DIRECTORY # ... assets # clear cache rm -Rf $WWW_PATH/protected/runtime/*