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.
8 BASE=/opt/apache-tomcat-8.0.37
14 echo "$0: option -i value is $hostip"
20 echo "$0: option -n value is $hostname"
26 echo "$0: option -b value is $BASE"
31 echo "$0: ignoring argument $key"
37 # Optionally add to /etc/hosts
38 # Docker-compose supplies arguments ""
39 if [ ${#hostip} -lt 3 -o ${#hostname} -lt 3 ]; then
40 echo "$0: values for IP (-i) and/or name (-n) are empty or short"
42 echo "$0: using IP-name arguments $hostip $hostname"
43 grep $hostname /etc/hosts
45 if [ $ret_code != 0 ]; then
46 echo "$0: extending hosts with $hostname"
47 echo "$hostip $hostname" >> /etc/hosts
49 echo "$0: hosts already has $hostname"
53 if [ ! -d $BASE ] ; then
54 echo "$0: $BASE not found or not a directory"
57 echo "$0: Starting server from $BASE"
58 LOGFILE=${BASE}/logs/catalina.out
59 echo "`date`:<-------------------- Starting -------------------->" >> $LOGFILE
60 exec ${BASE}/bin/catalina.sh run 2>&1 | tee -a $LOGFILE