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