#!/bin/bash BASE_PATH=`pwd` 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 echo 'Options -Indexes' > $PUB_BASE_PATH/web/$THUMBNAILS_DIRECTORY/.htaccess 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 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 echo 'Options -Indexes' > $PUB_BASE_PATH/web/$FILES_DIRECTORY/.htaccess 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 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 # thumbnails =>