if {ping -c 1 www || { "Destination Host Unreachable" ; }}
then
{ echo "neveikia senas-pastas, web serveris" | mailx -s "Senas web serveris" mail }
endif;
this is my script but it does not work...
this script will be used to check if website is online if not then sends an email...
#!/bin/bash
wget -t 1 WWW
if [ -f index.html ]
then
rm -rvf index.html
else
echo "does not work website in old-server" | mailx -s "Server named old-server does not work" user@host
fi
i used this script, because i need to know if PC is available... if server gives some error generated in index.html it is good, because on this PC are about 20 virtual sites in apache. if one is down others are in use and ping goes only to the router... and this PC/server is under 2 routers. big thanx for help to you all