cd /home/oracle/ if ping arrakis.ah.ru -c1; then if links -dump http://arrakis.ah.ru/portal/page/portal/internal/usefull/directory | grep "Internal Server Error"; then if [ -f 'notworking' ] then exit; fi; rm working; echo > notworking; ( sleep 1 echo "ehlo x" sleep 1 echo "mail from:olegon@ah.ru" sleep 1 echo "rcpt to:01@ah.ru" sleep 1 echo "data" sleep 1 echo "subject:Portal is down..." sleep 1 echo "from:olegon@ah.ru" sleep 1 echo "to:01@ah.ru" sleep 1 echo "Hello." sleep 1 echo "This is a test message." sleep 1 echo "Bye." sleep 1 echo "." sleep 1 echo "QUIT" ) | telnet mx.ah.ru 25; else if [ -f 'working' ] then exit; fi; rm notworking; echo > working; ( sleep 1 echo "ehlo x" sleep 1 echo "mail from:olegon@ah.ru" sleep 1 echo "rcpt to:oakulabuhov@ah.ru" sleep 1 echo "data" sleep 1 echo "subject:Portal is up..." sleep 1 echo "from:olegon@ah.ru" sleep 1 echo "to:oakulabuhov@ah.ru" sleep 1 sleep 1 echo "Hello." sleep 1 echo "This is a test message." sleep 1 echo "Bye." sleep 1 echo "." sleep 1 echo "QUIT" ) | telnet mx.ah.ru 25; fi; else if [ -f 'notworking' ] then exit; fi; rm working; echo > notworking; ( sleep 1 echo "ehlo x" sleep 1 echo "mail from:olegon@ah.ru" sleep 1 echo "rcpt to:oakulabuhov@ah.ru" sleep 1 echo "data" sleep 1 echo "subject:Portal is down..." sleep 1 echo "from:olegon@ah.ru" sleep 1 echo "to:oakulabuhov@ah.ru" sleep 1 sleep 1 echo "Hello." sleep 1 echo "This is a test message." sleep 1 echo "Bye." sleep 1 echo "." sleep 1 echo "QUIT" ) | telnet mx.ah.ru 25; fi;