Skip to content

Instantly share code, notes, and snippets.

@nigamankit7
Last active August 29, 2015 14:09
Show Gist options
  • Save nigamankit7/7d19b404883f5f1858a5 to your computer and use it in GitHub Desktop.
Save nigamankit7/7d19b404883f5f1858a5 to your computer and use it in GitHub Desktop.
This is a job which will run on the raspberry pi start up and will check current time. If between 5 AM - 8 AM then it will download the hindu newspaper
#!/bin/sh
currentTime=`date +%k%M`
check_time_to_run()
{
tempTime=$1
if [ $tempTime -gt 630 -a $tempTime -lt 800 ]; then
echo "Time is between 5 AM and 8 AM. Running Fetch_news.sh."
sudo sh /home/pi/scripts/fetch_news.sh
else
echo "This is not between 5 AM and 8 AM. ABORTING !"
exit 1
fi
}
check_time_to_run $currentTime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment