setup.sh 7.43 KB
#!/bin/bash
APPBASE="Anc"
APPNAME="Text"
APPBASELC="anc"
APPNAMELC="text"
APPDIR="/var/www/$2/${APPBASE}${APPNAME}"
echo "############"
echo "###########"
echo "########## Setup Script für ${APPBASE}${APPNAME} $1 $2"

####
#
#
##
if [ "$3" = "TRUE" ];then
 echo '*** !!! ACHTUNG NEWINSTALL = TRUE Datenbanken und Verzeichnisse der ${APPBASE}${APPNAME} werden gelöscht'
    # CODE
	echo "Lösche: rm -R $1/app/code/local/${APPBASE}/${APPNAME}"
	rm -R "$1/app/code/local/${APPBASE}/${APPNAME}"
	#ETC
	echo "Lösche: $1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
	rm -R "$1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
	#Design Adminhtml
	echo "Lösche: $1/app/design/adminhtml/base/default/layout/${APPBASELC}/${APPNAMELC}.xml"
	rm -R "$1/app/design/adminhtml/base/default/layout/${APPBASELC}/${APPNAMELC}.xml"
	echo "Lösche: $1/app/design/adminhtml/base/default/template/${APPBASELC}/${APPNAMELC}"
	rm -R "$1/app/design/adminhtml/base/default/template/${APPBASELC}/${APPNAMELC}"	
	#Design Frontend
	echo "Lösche: $1/app/design/frontend/base/default/layout/${APPBASELC}/${APPNAMELC}.xml"
	rm -R "$1/app/design/frontend/base/default/layout/${APPBASELC}_${APPNAMELC}.xml"
	echo "Lösche: $1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}"
	rm -R "$1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}"	
	#JS
	echo "Lösche: $1/js/${APPBASE}/${APPNAME}"
	rm -R "$1/js/${APPBASE}/${APPNAME}"
	#SKIN
	echo "Lösche: $1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}"
	rm -R "$1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}"
	rm "$1/skin/adminhtml/base/default/css/${APPBASELC}/${APPNAMELC}"
	exit 0
	
fi




###
# Code Local
#
##
if [ ! -d "$1/app/code/local/${APPBASE}" ];then
    echo "*** Erstelle das Verzeichniss: $1/app/code/local/${APPBASE}"
	mkdir "$1/app/code/local/${APPBASE}"
fi 
if [ ! -d "$1/app/code/local/${APPBASE}/${APPNAME}" ];then
	echo "*** Verlinke Verzeichniss: $APPDIR/app/code/local/${APPBASE}/${APPNAME} $1/app/code/local/${APPBASE}/${APPNAME}"
	ln -s   $APPDIR/app/code $1/app/code/local/${APPBASE}/${APPNAME}
fi 


###
# etc
#
##
if [ ! -f "$1/app/etc/modules/${APPBASE}_${APPNAME}.xml" ];then
	echo "*** Verlinke Datei: $1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
	ln -s   $APPDIR/app/etc/modules/${APPBASE}_${APPNAME}.xml $1/app/etc/modules/${APPBASE}_${APPNAME}.xml
fi 




###
# Design Adminhtml
#
##
#if [ ! -d "$1/app/design/frontend/base/default/layout" ];then
#	 echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/layout"
#	 mkdir "$1/app/design/frontend/base/default/layout"
#fi
#if [ ! -d "$1/app/design/adminhtml/base/default/layout/${APPBASELC}" ];then
#	 echo "*** Erstelle das Verzeichniss: $1/app/design/adminhtml/base/default/layout/${APPBASELC}"
#	 mkdir "$1/app/design/adminhtml/base/default/layout/${APPBASELC}"
#fi
#if [ ! -f "$1/app/design/adminhtml/base/default/layout/${APPBASELC}/${APPNAMELC}.xml" ];then
#	echo "*** Verlinke Datei: $APPDIR/app/design/adminhtml/layout/${APPBASELC}/${APPNAMELC}.xml $1/app/design/adminhtml/base/default/layout/${APPBASELC}/${APPNAMELC}.xml"
#	ln -s   $APPDIR/app/design/adminhtml/layout/${APPBASELC}/${APPNAMELC}.xml $1/app/design/adminhtml/base/default/layout/${APPBASELC}/${APPNAMELC}.xml
#fi 
if [ ! -d  "$1/app/design/adminhtml/base/default/template/${APPBASELC}" ];then
	 echo  "*** Erstelle das Verzeichniss: $1/app/design/adminhtml/base/default/template/${APPBASELC}"
	 mkdir "$1/app/design/adminhtml/base/default/template/${APPBASELC}"
fi
if [ ! -d "$1/app/design/adminhtml/base/default/template/${APPBASELC}/${APPNAMELC}" ];then
	echo "***### Verlinke Datei: $APPDIR/app/design/adminhtml/template $1/app/design/adminhtml/base/default/template/${APPBASELC}/${APPNAMELC}"
	ln -s   $APPDIR/app/design/adminhtml/template $1/app/design/adminhtml/base/default/template/${APPBASELC}/${APPNAMELC}
fi 



###
# Design Frontend
#
##
if [ ! -d "$1/app/design/frontend/base/default/layout" ];then
	 echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/layout"
	 mkdir "$1/app/design/frontend/base/default/layout"
fi
if [ ! -d "$1/app/design/frontend/base/default/layout/${APPBASELC}" ];then
	 echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/layout/${APPBASELC}"
	 mkdir "$1/app/design/frontend/base/default/layout/${APPBASELC}"
fi
if [ ! -f "$1/app/design/frontend/base/default/layout/${APPBASELC}/${APPNAMELC}.xml" ];then
	echo "*** Verlinke Datei: $APPDIR/app/design/frontend/layout/${APPBASELC}/${APPNAMELC}.xml $1/app/design/frontend/base/default/layout/${APPBASELC}/${APPNAMELC}.xml"
#	ln -s   $APPDIR/app/design/frontend/layout/${APPBASELC}_${APPNAMELC}.xml $1/app/design/frontend/base/default/layout/${APPBASELC}_${APPNAMELC}.xml
	ln -s   $APPDIR/app/design/frontend/layout/${APPNAMELC}.xml $1/app/design/frontend/base/default/layout/${APPBASELC}/${APPNAMELC}.xml
fi 
if [ ! -d "$1/app/design/frontend/base/default/template" ];then
	 echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/template"
	 mkdir "$1/app/design/frontend/base/default/template"
fi
if [ ! -d "$1/app/design/frontend/base/default/template/${APPBASELC}" ];then
	 echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/template/${APPBASELC}"
	 mkdir "$1/app/design/frontend/base/default/template/${APPBASELC}"
fi
if [ ! -d "$1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}" ];then
	echo "*** Verlinke Datei: $APPDIR/app/design/frontend/template/${APPBASELC}/${APPNAMELC} $1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}"
	ln -s   $APPDIR/app/design/frontend/template $1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}
fi 


###
# js
#
##
if [ ! -d "$1/js/${APPBASE}" ];then
    echo "*** Erstelle das Verzeichniss: $1/js/${APPBASE}"
	mkdir "$1/js/${APPBASE}"
fi 
if [ ! -d "$1/js/${APPBASE}/${APPNAME}" ];then
	echo "*** Verlinke Verzeichniss: $APPDIR/js $1/js/${APPBASE}/${APPNAME}"
	ln -s   $APPDIR/js $1/js/${APPBASE}/${APPNAME}
fi 


###
# skin
#
##
if [ ! -d "$1/skin/frontend/base/default/css/${APPBASELC}" ];then
    echo "*** Erstelle das Verzeichniss: $1/skin/frontend/base/default/css/${APPBASELC}"
	mkdir -p "$1/skin/frontend/base/default/css/${APPBASELC}"
fi 
if [ ! -d "$1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}" ];then
	echo "*** Verlinke Verzeichniss: $APPDIR/js $1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}"
	ln -s   $APPDIR/skin/frontend/css $1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}
fi 
if [ ! -d "$1/skin/frontend/base/default/texts/${APPBASELC}" ];then
    echo "*** Erstelle das Verzeichniss: $1/skin/frontend/base/default/texts/${APPBASELC}"
	mkdir -p "$1/skin/frontend/base/default/texts/${APPBASELC}"
fi 
if [ ! -d "$1/skin/frontend/base/default/texts/${APPBASELC}/${APPNAMELC}" ];then
	echo "*** Verlinke Verzeichniss: $APPDIR/js $1/skin/frontend/base/default/texts/${APPBASELC}/${APPNAMELC}"
	ln -s   $APPDIR/skin/frontend/texts $1/skin/frontend/base/default/texts/${APPBASELC}/${APPNAMELC}
fi 



###
# skin Adminhtml
#
##
if [ ! -d "$1/skin/adminhtml/base/default/css/${APPBASELC}" ];then
    echo "*** Erstelle das Verzeichniss: $1/skin/frontend/base/default/css/${APPBASELC}"
	mkdir -p  "$1/skin/adminhtml/base/default/css/${APPBASELC}"
fi 
if [ ! -d "$1/skin/adminhtml/base/default/css/${APPBASELC}/${APPNAMELC}" ];then
	echo "*** Verlinke Verzeichniss: $APPDIR/skin/adminhtml/css $1/skin/adminhtml/base/default/css/${APPBASELC}/${APPNAMELC}"
	ln -s   $APPDIR/skin/adminhtml/css $1/skin/adminhtml/base/default/css/${APPBASELC}/${APPNAMELC}
fi