Blame tests/p_tomcat/1-config_tomcat.sh

Athmane Madjoudj 0a3c81
#!/bin/bash
Athmane Madjoudj 0a3c81
# Author: Athmane Madjoudj <athmanem@gmail.com>
Athmane Madjoudj 0a3c81
Athmane Madjoudj 0a3c81
t_Log "$0 - Configuring Tomcat"
Athmane Madjoudj 0a3c81
a160cc
if [ "$centos_ver" = "7" ] ;then
a160cc
   TOMCAT_SRV_NAME=tomcat
a160cc
   TOMCAT_CONF_DIR=/etc/tomcat/
a160cc
elif [ "$centos_ver" = "6" ] ; then
Athmane Madjoudj 0a3c81
   TOMCAT_SRV_NAME=tomcat6
Athmane Madjoudj 0a3c81
   TOMCAT_CONF_DIR=/etc/tomcat6/
Athmane Madjoudj 0a3c81
else
Athmane Madjoudj 0a3c81
   TOMCAT_SRV_NAME=tomcat5
Athmane Madjoudj 0a3c81
   TOMCAT_CONF_DIR=/etc/tomcat5/
Athmane Madjoudj 0a3c81
fi
Athmane Madjoudj 0a3c81
a160cc
if [ "$centos_ver" = "7" ] ;then
a160cc
  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 
a160cc
else
a160cc
  sed -i 's/<\/tomcat-users>/<user username="admin" password="admin" roles="admin,manager"\/>\n<\/tomcat-users>/' $TOMCAT_CONF_DIR/tomcat-users.xml 
a160cc
fi
Athmane Madjoudj 0a3c81
Athmane Madjoudj 0a3c81
service $TOMCAT_SRV_NAME restart
Athmane Madjoudj aa8ab0
Athmane Madjoudj aa8ab0
# we need extra sec for tomcat
Athmane Madjoudj a1c6c7
sleep 10