title: How do i write a shell script for checking website live or not
body: <p>I am writing a shell script to monitor website live or not and send an email alert below is my code </p>
  
  <pre><code>#!/bin/bash
  if [[ curl -s --head  --request GET http://opx.com/opx/version | grep "200 OK" &gt; /dev/null] &amp;&amp; [ curl -s --head --request GET http://oss.com/version | grep "200 OK" &gt; /dev/null ]]
  then echo "The HTTP server on opx.com and oss.com is up!" #&gt; /dev/null
  else
  msg="The HTTP server  opx.com Or oss.com is down "
  email="opx-noc@opx.com"
  
  curl --data "body=$msg &amp;to=$email &amp;subject=$msg" https://opx.com/email/send
  fi;
  </code></pre>
  
  <p>if i run this code i got </p>
  
  <pre><code>./Monitoring_Opx_Oss: line 2: conditional binary operator expected
  ./Monitoring_Opx_Oss: line 2: syntax error near `-s'
  ./Monitoring_Opx_Oss: line 2: `if [[ curl -s --head  --request GET http://opx.com/opx/version | grep "200 OK" &gt; /dev/null] &amp;&amp; [ curl -s --head --request GET http://oss.com/version | grep "200 OK" &gt; /dev/null ]] '
  </code></pre>
  
  <p>Please correct me...</p>