setup.sh 2.08 KB
#!/bin/bash
ALF_HOME=/opt/alfresco
TOMCAT_HOME=$ALF_HOME/tomcat
EXTROOT=$TOMCAT_HOME/shared/classes
EXTDIR_REPO=$EXTROOT/alfresco/extension
EXTDIR_MESSAGES=$EXTROOT/alfresco/messages
EXTDIR_SHARE=$EXTROOT/alfresco/web-extension

echo "+--------------------------------------+"
echo "| Course Setup for End/Power Users     |"
echo "+--------------------------------------+"
read -p "Press [ENTER] to continue..."

echo "Shutting Down Alfresco..."
pushd .
cd $ALF_HOME
$ALF_HOME/alfresco.sh stop
echo "Sleeping..."
echo "60 secs..."
sleep 15s
echo "45 secs..."
sleep 15s
echo "30 secs..."
sleep 15s
echo "15 secs..."
sleep 15s
killall java
popd

echo "Backing up share-config-custom.xml..."
mv $EXTDIR_SHARE/share-config-custom.xml $EXTDIR_SHARE/old.share-config-custom.xml

echo "Installing share config..."
cp setup/share-config-custom.xml $EXTDIR_SHARE/share-config-custom.xml

#echo "Backing up alfresco-global.properties..."
#mv $EXTROOT/alfresco-global.properties $EXTROOT/old.alfresco-global.properties

#echo "Installing alfresco-global.properties..."
#cp setup/alfresco-global.properties $EXTROOT/alfresco-global.properties

echo "Installing sopModel..."
cp ../Common/Models/sopModel.xml $EXTDIR_REPO/sopModel.xml
cp ../Common/Models/sopModel-context.xml $EXTDIR_REPO/sopModel-context.xml

cd setup/
echo "Installing .properties file..."
cp sop-share-context.xml $EXTDIR_SHARE/sop-share-context.xml
cp sopResourceBundle.properties $EXTDIR_MESSAGES/sopResourceBundle.properties


echo "Removing Records Management..."
rm $ALF_HOME/amps/alfresco-rm-2.0.2-171.amp
rm $ALF_HOME/amps_share/alfresco-rm-share-2.0.2-171.amp
pushd .
cd $ALF_HOME

#java -jar $ALF_HOME/bin/alfresco-mmt.jar install $ALF_HOME/amps/alfresco-rm-2.0.2-171.amp $TOMCAT_HOME/webapps/alfresco.war
#java -jar $ALF_HOME/bin/alfresco-mmt.jar install $ALF_HOME/amps-share/alfresco-rm-share-2.0.2-171.amp $TOMCAT_HOME/webapps/share.war -force

rm -rf $TOMCAT_HOME/webapps/alfresco
rm -rf $TOMCAT_HOME/webapps/share
$ALF_HOME/bin/clean_tomcat.sh

echo "Starting Alfresco now..."
cd $ALF_HOME
$ALF_HOME/alfresco.sh start
popd

echo "Course Setup completed."
exit 0