#!/bin/bash # # Install script # chowndir () { thisOWNER=${1} thisDIR=${2} [ -d ${thisDIR} ] && chown -R ${thisOWNER}:${GROUPNAME} ${thisDIR} || echo ${thisDIR} doesn\'t exist } MYDIR=`pwd` SITE=../`basename ${MYDIR}` echo Setting permissions for ${SITE} if [ "`hostname`" = "imrailo05.iconz.impactmedia.co.nz" ] ; then OWNER=mbaldwin else OWNER=nobody fi GROUPNAME=apache chowndir ${OWNER} ${SITE} chowndir ${GROUPNAME} ${SITE}/WEB-INF/ chowndir ${GROUPNAME} ${SITE}/temp chowndir ${GROUPNAME} ${SITE}/images/ chowndir tomcat ${SITE}/images/../assets/img/homepage echo Done