#!/bin/bash BASE_PATH=`pwd` USER_NAME=$(whoami) PUB_BASE_PATH=$(pwd | sed "s/\/home\/$USER_NAME\//\/home\/pub\//") # Init Directory. # Argument $1 = path initDir() { path=$1 if [ ! -d "$PUB_BASE_PATH/$path" ] ; then mkdir -p "$PUB_BASE_PATH/$path" chmod -R 777 "$PUB_BASE_PATH/$path" 2>/dev/null fi if [ -d "$BASE_PATH/$path" ] ; then rm -Rf $BASE_PATH/$path fi if [ -L "$BASE_PATH/$path" ] ; then unlink $BASE_PATH/$path fi ln -sT $PUB_BASE_PATH/$path $BASE_PATH/$path } chmod -R 777 site/tmp 2>/dev/null initDir "www/fckfiles"