| 2474 |
rajveer |
1 |
#!/bin/bash
|
|
|
2 |
|
|
|
3 |
# resolve links - $0 may be a softlink
|
|
|
4 |
PRG="$0"
|
|
|
5 |
|
|
|
6 |
while [ -h "$PRG" ]; do
|
|
|
7 |
ls=`ls -ld "$PRG"`
|
|
|
8 |
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
|
9 |
if expr "$link" : '/.*' > /dev/null; then
|
|
|
10 |
PRG="$link"
|
|
|
11 |
else
|
|
|
12 |
PRG=`dirname "$PRG"`/"$link"
|
|
|
13 |
fi
|
|
|
14 |
done
|
|
|
15 |
|
|
|
16 |
# Get standard environment variables
|
|
|
17 |
PRGDIR=`dirname $(readlink -f "$PRG")`
|
|
|
18 |
|
|
|
19 |
PROJECT_DIR="`dirname ${PRGDIR}`"
|
|
|
20 |
|
|
|
21 |
MAVEN_REPO="${HOME}/.m2/repository"
|
|
|
22 |
M2_CLASSPATH="${MAVEN_REPO}/in/shop2020/ContentStore/1.0-SNAPSHOT/ContentStore-1.0-SNAPSHOT.jar:${MAVEN_REPO}/in/shop2020/ThriftConfig/1.0-SNAPSHOT/ThriftConfig-1.0-SNAPSHOT.jar:${MAVEN_REPO}/in/shop2020/Common/1.0-SNAPSHOT/Common-1.0-SNAPSHOT.jar:${MAVEN_REPO}/readonly/apache/velocity/1.6.3/velocity-1.6.3.jar:${MAVEN_REPO}/readonly/apache/commons-lang/2.4/commons-lang-2.4.jar:${MAVEN_REPO}/readonly/apache/commons-collections/3.2.1/commons-collections-3.2.1.jar:${MAVEN_REPO}/readonly/apache/thrift/0.2.0/thrift-0.2.0.jar:${MAVEN_REPO}/readonly/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.jar:${MAVEN_REPO}/readonly/slf4j/slf4j-simple/1.5.8/slf4j-simple-1.5.8.jar:${MAVEN_REPO}/readonly/apache/commons-logging-api/1.1/commons-logging-api-1.1.jar:${MAVEN_REPO}/readonly/bdb/je/4.1.7/je-4.1.7.jar:${MAVEN_REPO}/readonly/jython/2.5.1/jython-2.5.1.jar"
|
|
|
23 |
|
|
|
24 |
echo "Stopping tomcat at `date +%c`"
|
|
|
25 |
echo "======================================================="
|
|
|
26 |
/etc/init.d/tomcat6 stop
|
|
|
27 |
|
|
|
28 |
echo "======================================================="
|
|
|
29 |
cd ${PROJECT_DIR}/ContentStore
|
|
|
30 |
java -cp ${M2_CLASSPATH} in.shop2020.util.ContentMigrator 1 2 true
|
|
|
31 |
echo "Content generation completed"
|
|
|
32 |
echo "======================================================="
|
|
|
33 |
/etc/init.d/tomcat6 start
|