title: Shell script not running via crontab, but runs fine manually
body: <p>I have a script that checks if the <a href="https://en.wikipedia.org/wiki/Point-to-Point_Tunneling_Protocol" rel="noreferrer">PPTP</a> VPN is running, and if not it reconnects the PPTP VPN. When I run the script manually it executes fine, but when I make a cron job, it's not running.</p>
  <pre><code>* * * * * /bin/bash /var/scripts/vpn-check.sh
  </code></pre>
  <p>Here is the script:</p>
  <pre class="lang-sh prettyprint-override"><code>#!/bin/sh
  /bin/ping -c3 192.168.17.27 &gt; /tmp/pingreport
  result=`grep &quot;0 received&quot; /tmp/pingreport`
  truncresult=&quot;`echo &quot;$result&quot; | sed 's/^\(.................................\).*$$'`&quot;
  if [[ $truncresult == &quot;3 packets transmitted, 0 received&quot; ]]; then
  /usr/sbin/pppd call home
  fi
  </code></pre>