I want to write a script to check out if the website is working fine by checking out some of it is contents. If the content exists in the result, it prints a message telling the website is working fine, otherwise, it will show an error:
#!/bin/bash
webserv="10.1.1.1"
Keyword="helloworld" # enter the keyword for test content
if (curl -s "$webserv" | grep "$keyword")
# if the keyword is in the conent
echo " the website is working fine"
else
echo "Error"
Any suggestion how to do that?