title: Negate if condition in bash script
body: <p>I'm new to bash and I'm stuck at trying to negate the following command:</p>
  
  <pre><code>wget -q --tries=10 --timeout=20 --spider http://google.com
  if [[ $? -eq 0 ]]; then
          echo "Sorry you are Offline"
          exit 1
  </code></pre>
  
  <p>This if condition returns true if I'm connected to the internet. I want it to happen the other way around but putting <code>!</code> anywhere doesn't seem to work.</p>