title: Ping on bash script, ping if down then exit script
body: <p>I am making a bash script to configure some devices we use, but im trying to make a log in it, in other words.. when the script starts checks the date, time , user, and other values and then >  this values to a csv in a remote server.</p>
  
  <p>I need the ping to check if the server its available, and if it doesnt, then quit program.</p>
  
  <p>so i tried.</p>
  
  <blockquote>
    <p>ping -c 1 X.X.X.X >/dev/null || exit;</p>
  </blockquote>
  
  <p>and it worked but i need to echo why it stopped, so i tried:</p>
  
  <blockquote>
    <p>ping -c 1 x.x.x.x >/dev/null || echo " The remote server is unavailable" ; exit; </p>
  </blockquote>
  
  <p>Buen when i do this the program exits even if the ping went well..</p>
  
  <p>In less words, im trying after "||" to have an echo and then exit the script, and im not sure how to do it. Everything else works like sharm, and if i remove the echo, the exit; option works fine..</p>
  
  <p>Thanks in advance for your help.</p>
  
  <p>Noobie.</p>