2 # Starts the Apache-Tomcat web container.
3 # If arguments "-i ip.2.3.4" AND "-n name" are present, adds an entry to /etc/hosts;
4 # this was added as a workaround for missing DNS in the CSIT environment.
13 echo "$0: option -i value is $hostip"
19 echo "$0: option -n value is $hostname"
24 echo "$0: ignoring argument $key"
30 # Optionally add to /etc/hosts
31 # Docker-compose supplies arguments ""
32 if [ ${#hostip} -lt 3 -o ${#hostname} -lt 3 ]; then
33 echo "$0: values for IP (-i) and/or name (-n) are empty or short"
35 echo "$0: using IP-name arguments $hostip $hostname"
36 grep $hostname /etc/hosts
38 if [ $ret_code != 0 ]; then
39 echo "$0: extending hosts with $hostname"
40 echo "$hostip $hostname" >> /etc/hosts
42 echo "$0: hosts already has $hostname"
46 BASE=/opt/apache-tomcat-8.0.37
47 if [ ! -d $BASE ] ; then
48 echo "$0: $BASE not found or not a directory"
51 echo "$0: Starting server from $BASE"
52 LOGFILE=${BASE}/logs/catalina.out
53 echo "`date`:<-------------------- Starting -------------------->" >> $LOGFILE
54 exec ${BASE}/bin/catalina.sh run 2>&1 | tee -a $LOGFILE