title: Correct Formatting of Multiple Condition Bash IF Statement
body: <p>I am trying to use an IF statement to:</p>
  <ol>
  <li>Check if a server is UP</li>
  <li>Check if a file exists on the server</li>
  </ol>
  <p><strong>My Code So Far</strong></p>
  <pre><code>hostname=&quot;somehost.com&quot;
  file=&quot;somefile.txt&quot;
  URL=&quot;https://${hostname}/some/directory/${file}&quot;
  if [ &quot;ping -c 1 -W 1 ${hostname} 2&gt;/dev/null&quot; ] &amp; [ &quot;wget --spider ${URL} 2&gt;/dev/null&quot; ];
  then
  echo -e &quot;${hostname} is UP and ${file} is AVAILABLE&quot;
  else
  echo -e &quot;${hostname} is DOWN or ${file} is UNAVAILABLE&quot;
  fi
  </code></pre>
  <p>I have tried testing the IF statement by entering an incorrect hostname and an incorrect file but, the result is incorrect.</p>
  <p><strong>Current Output</strong></p>
  <pre><code>somehost.com is UP and somefile.txt is AVAILABLE
  </code></pre>
  <p><strong>Expected Output</strong></p>
  <pre><code>somehost.com is DOWN and somefile.txt is DOWN
  </code></pre>