Security/ Package Name changes
[portal.git] / deliveries / start-apache-tomcat.sh
old mode 100755 (executable)
new mode 100644 (file)
similarity index 69%
rename from deliveries/start-apps-cmd.sh
rename to deliveries/start-apache-tomcat.sh
index 7d3a8ad..db39248
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Starts the Apache-Tomcat web container with the Portal, EPSDK and DMaaP BC web apps.
+# 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.
 
@@ -10,11 +10,13 @@ while [ $# -gt 0 ]; do
     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
         ;;
@@ -26,14 +28,18 @@ while [ $# -gt 0 ]; do
 done
 
 # Optionally add to /etc/hosts
-if [ -z "${hostip}" -o -z "${hostname}" ]; then
-    echo "$0: Arguments for IP and name not found, continuing."
+# 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"
+    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