Hi all,
i need to do the following,
when i connect to my website it prints out "Welcome User",
but sometimes there are errors like "dictionary not loaded" or "wrong user name or password"
so i wanted to make a script that checks that login page,
and if i get the Welcome massage do nothing,
if i get any other errors/messages i need to restart tomcat
because that is the only solution i have to solve these issues.
#!/bin/sh
url=`www.mywebsite.login.jsp?Username=test&UserPassword=foo`
#check if i get welcome message
if [ $url = Welcome ] ;
then
echo "website is up and running"
else #every thing else printe i need to restart tomcat
/etc/init.d/tomcat restart | echo "$url is down" mail -s 'restarting website' admin@mydomain.com;
fi
Can any body help me on how to configure this script?
Thanks in advance.