Last active
August 29, 2015 14:09
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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