Check website is up or not
Hi All,
Now we are gonna check the particular website is up or not. For that we need the lynx command
lynx is a general purpose distributed information browser for the World Wide Web
if you don’t have command in your OS, then you can download and install it from the below URL
http://lynx.isc.org/
or if you use the ubuntu, then execute the below command
sudo apt-get install lynx
Once it is installed, you can try the below program.
$ cat website_test.sh
lynx -dump $1 &> /dev/null
if [ $? = 0 ]
then
echo “website is up”
else
echo “website is down. Trigger the email”
fi
Output :
$ ./website_test.sh http://google.com
website is up
$ ./website_test.sh http://google32323232.com
website is down. Trigger the email
Recent Comments