The test suite we use to indicate functional acceptance of a machine instance
Johnny Hughes
2019-02-08 5c57733c7278bf5e6843e34d811f362e8c1c9c13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Author: Athmane Madjoudj <athmanem@gmail.com>
uname_arch=$(uname -m)
 
t_Log "$0 - Configuring Tomcat"
 
if [ "$centos_ver" = "7" ] ;then
   TOMCAT_SRV_NAME=tomcat
   TOMCAT_CONF_DIR=/etc/tomcat/
elif [ "$centos_ver" = "6" ] ; then
   TOMCAT_SRV_NAME=tomcat6
   TOMCAT_CONF_DIR=/etc/tomcat6/
else
   TOMCAT_SRV_NAME=tomcat5
   TOMCAT_CONF_DIR=/etc/tomcat5/
fi
 
if [ "$centos_ver" = "7" ] ;then
  sed -i 's/<\/tomcat-users>/<user username="admin" password="admin" roles="admin,manager,admin-gui,manager-gui"\/>\n<\/tomcat-users>/' $TOMCAT_CONF_DIR/tomcat-users.xml 
else
  sed -i 's/<\/tomcat-users>/<user username="admin" password="admin" roles="admin,manager"\/>\n<\/tomcat-users>/' $TOMCAT_CONF_DIR/tomcat-users.xml 
fi
 
service $TOMCAT_SRV_NAME restart
 
# we need extra sec for tomcat (and even more time for armhfp)
if [ "$uname_arch" == "armv7l" ] ; then
  sleep_time="300"
else
  sleep_time="10"
fi
 
t_Log "Sleeping $sleep_time seconds for $uname_arch"
sleep $sleep_time