input=$1
if [ $input = "stop" ]
then
sh /home/lovebharti/Yatra/installed/apache-tomcat-7.0.61/bin/shutdown.sh
#echo pbharti|sudo -S service apache2 stop
elif [ $input = "restart" ]
then
sh /home/lovebharti/Yatra/installed/apache-tomcat-7.0.61/bin/shutdown.sh
sh /home/lovebharti/Yatra/installed/apache-tomcat-7.0.61/bin/catalina.sh jpda start
#sudo service apache2 restart
elif [ $input = "deploy" ]
then
sh /home/lovebharti/Yatra/installed/apache-tomcat-7.0.61/bin/shutdown.sh
echo "--Apache shudown"
#rm -r /home/lovebharti/Yatra/installed/apache-tomcat-7.0.61/webapps/cityguide
#rm -r /home/lovebharti/Yatra/installed/apache-tomcat-7.0.61/webapps/cityguideSchedular
rm -r /home/lovebharti/Yatra/installed/apache-tomcat-7.0.61/webapps/MultilingualServiceImpl.war
rm -r /home/lovebharti/Yatra/installed/apache-tomcat-7.0.61/webapps/MultilingualServiceImpl
sleep 3s
echo "--WebApp removed from tomcat"
cp -r /home/lovebharti/Yatra/Multilingual/MultilingualServiceImpl/trunk/target/MultilingualServiceImpl.war /home/lovebharti/Yatra/installed/apache-tomcat-7.0.61/webapps/MultilingualServiceImpl.war
sleep 3s
echo "--WebApp copied from target"
sh /home/lovebharti/Yatra/installed/apache-tomcat-7.0.61/bin/catalina.sh jpda start
echo "restarting apache... "
sleep 1s
#terminal -e sh showLog.sh
echo "starting tomcat in debug mode"
sleep 1s
#tail -f /home/lovebharti/Yatra/installed/apache-tomcat-7.0.61/logs/catalina.out
echo "cleaning logs"
> /home/lovebharti/YT/var/log/Multilingual/Multilingual.log
echo "showing log"
tail -f /home/lovebharti/YT/var/log/Multilingual/Multilingual.log
echo "showing tomcat output"
else
echo "others"
fi
#sh multilingual.sh start/stop/restart