Project

General

Profile

« Previous | Next » 

Revision 8929

Added by Jing Tao about 10 years ago

Added the code to modify the geo data directory in the metacat.properties file.

View differences:

src/scripts/bash/install-java7-tomcat7.sh
6 6
#It will move Metacat and other web applications from the old context directory to the new context directory.
7 7
#The user running the script should have the sudo permission.
8 8

  
9
APACHE_SITE_FILE=/etc/apache2/sites-available/knb-ssl
9 10
NEW_JDK_PACKAGE=openjdk-7-jdk
10 11
NEW_JDK_HOME=/usr/lib/jvm/java-7-openjdk-amd64
11 12

  
......
73 74
                s/(workers\.java_home=).*/\1${SAFE_NEW_JDK_HOME}/;"\
74 75
                $JK_WORKER_PATH
75 76

  
77
echo "update the apache site file by replacing $OLD_TOMCAT by $NEW_TOMCAT"
78
sudo sed -i.bak "s/${OLD_TOMCAT}/${NEW_TOMCAT}/;" $APACHE_SITE_FILE
79

  
76 80
echo "move Metacat and other web applications from $OLD_TOMCAT to $NEW_TOMCAT"
77 81
sudo ${INIT_START_DIR}/${OLD_TOMCAT} stop
78 82
sudo ${INIT_START_DIR}/${NEW_TOMCAT} stop
......
85 89
if [ -f "$NEW_TOMCAT_BASE/$WEBAPPS/$KNB/WEB-INF/metacat.properties" ]; then
86 90
	echo "$NEW_TOMCAT_BASE/$WEBAPPS/$KNB/WEB-INF/metacat.properties exists and the application.deployDir will be updated"	
87 91
	sudo sed -i.bak --regexp-extended "s/(application\.deployDir=).*/\1${SAFE_NEW_TOMCAT_WEBAPPS}/;" $NEW_TOMCAT_BASE/$WEBAPPS/$KNB/WEB-INF/metacat.properties
92
        sudo sed -i --regexp-extended "s/(geoserver\.GEOSERVER_DATA_DIR=).*/\1${SAFE_NEW_TOMCAT_WEBAPPS}\/${KNB}\/spatial\/geoserver\/data/;" $NEW_TOMCAT_BASE/$WEBAPPS/$KNB/WEB-INF/metacat.properties
88 93
else
89 94
	echo "$NEW_TOMCAT_BASE/$WEBAPPS/$KNB/WEB-INF/metacat.properties does NOT exists and the application.deployDir will NOT be updated"
90 95
fi
......
92 97
if [ -f "$NEW_TOMCAT_BASE/$WEBAPPS/$METACAT/WEB-INF/metacat.properties" ]; then
93 98
                echo "$NEW_TOMCAT_BASE/$WEBAPPS/$METACAT/WEB-INF/metacat.properties eixsts and the application.deployDir will be updated" 
94 99
                sudo sed -i.bak --regexp-extended "s/(application\.deployDir=).*/\1${SAFE_NEW_TOMCAT_WEBAPPS}/;" $NEW_TOMCAT_BASE/$WEBAPPS/$METACAT/WEB-INF/metacat.properties
100
		sudo sed -i --regexp-extended "s/(geoserver\.GEOSERVER_DATA_DIR=).*/\1${SAFE_NEW_TOMCAT_WEBAPPS}\/${METACAT}\/spatial\/geoserver\/data/;" $NEW_TOMCAT_BASE/$WEBAPPS/$METACAT/WEB-INF/metacat.properties
95 101
else 
96 102
  echo "$NEW_TOMCAT_BASE/$WEBAPPS/$METACAT/WEB-INF/metacat.properties doesn't eixt and the application.deployDir will NOT be updated"
97 103
fi

Also available in: Unified diff