diff options
author | st782s <statta@research.att.com> | 2018-01-30 17:29:36 -0500 |
---|---|---|
committer | st782s <statta@research.att.com> | 2018-02-01 15:10:02 -0500 |
commit | 21a8761f684745bb300e075c7e98ad897ace9eed (patch) | |
tree | 6d585c3fe39fbb42a314941dbc8646e6ccf188cf /deliveries/start-apache-tomcat.sh | |
parent | 3af8af1310d5a27cb58be29505573f0bbdc1717c (diff) |
Security/ Package Name changes
Issue-ID: PORTAL-174, PORTAL-157, PORTAL-156, PORTAL-148, PORTAL-145,
PORTAL-140, PORTAL-133, PORTAL-121, PORTAL-111, PORTAL-88
Includes security fixes, Role Centralization, replace certain ECOMP
occurrences etc
Change-Id: I3c8b706709c6b92e646e3cbe50c2d660e8a46ef4
Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'deliveries/start-apache-tomcat.sh')
-rw-r--r-- | deliveries/start-apache-tomcat.sh | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/deliveries/start-apache-tomcat.sh b/deliveries/start-apache-tomcat.sh new file mode 100644 index 00000000..db39248b --- /dev/null +++ b/deliveries/start-apache-tomcat.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# Starts the Apache-Tomcat web container. +# If arguments "-i ip.2.3.4" AND "-n name" are present, adds an entry to /etc/hosts; +# this was added as a workaround for missing DNS in the CSIT environment. + +hostip="" +hostname="" +while [ $# -gt 0 ]; do + key="$1" + case $key in + -i|--ip) + hostip="$2" + echo "$0: option -i value is $hostip" + shift # past argument + shift # past value + ;; + -n|--name) + hostname="$2" + echo "$0: option -n value is $hostname" + shift # past argument + shift # past value + ;; + *) + echo "$0: ignoring argument $key" + shift + ;; + esac +done + +# Optionally add to /etc/hosts +# Docker-compose supplies arguments "" +if [ ${#hostip} -lt 3 -o ${#hostname} -lt 3 ]; then + echo "$0: values for IP (-i) and/or name (-n) are empty or short" +else + echo "$0: using IP-name arguments $hostip $hostname" + grep $hostname /etc/hosts + ret_code=$? + if [ $ret_code != 0 ]; then + echo "$0: extending hosts with $hostname" + echo "$hostip $hostname" >> /etc/hosts + else + echo "$0: hosts already has $hostname" + fi +fi + +BASE=/opt/apache-tomcat-8.0.37 +if [ ! -d $BASE ] ; then + echo "$0: $BASE not found or not a directory" + exit 1 +fi +echo "$0: Starting server from $BASE" +LOGFILE=${BASE}/logs/catalina.out +echo "`date`:<-------------------- Starting -------------------->" >> $LOGFILE +exec ${BASE}/bin/catalina.sh run 2>&1 | tee -a $LOGFILE |