I tried to use cron to periodically test the internet connection with a bash script. The cron job self works, the script is called.
However, in the script I want to open Google Chrome using the command
chromium-browser --args http://www.google.com
it works perfectly when the script is called directly through the terminal.
The command however does not work when the script is called from cron. The logging works perfectly the right way.
Anyone knows what to do here?
Here is the data:
crontab -e:
* * * * * /home/user/checkinet.sh
checkinet.sh:
url="www.google.com";
if ping -c 1 $url
then
echo "Internet is up!" >> /tmp/inetcheck.log
chromium-browser --args http://www.google.com
else
echo "Intenet is down!" >> /tmp/inetcheck.log
fi
Bookmarks