View Single Post
Old 01-16-2014, 03:00 AM   #8
pacraf
Junior Member
pacraf began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2014
Device: K3 keyboard
Now code blocks looks much better ...
so second script is not for me. that's clear too...

I will go the cron job way, but...
I have some doubts before I will touch my k3 cron job list...
My poor experience says that if I will modify cron job list - then all these tasks will be processed all the time (according to programmed schedule , so for example every 30 minutes. So, after that every 30 minutes of reading (or whatever) , the screen will be took over by weather script... and cron is started with system boot - so no chance to switch it off (without change of cron job list)...

so if I put in cron a starter for script - how to stop it (and start after lets say a day of normal reading on device) ?

cron job line example :
Code:
*/30 * * * * /mnt/us/weather/weather.sh


****edit *****

after some googling I found another example of weather scripts, but this example has two files, but it looks like similar functionality as first script.

weather.sh

Code:
#!/bin/sh

cd "$(dirname "$0")"

rm weather-script-output.png
eips -c
eips -c

if wget http://server/path/to/weather-script-output.png; then
        eips -g weather-script-output.png
else
        eips -g weather-image-error.png
fi
init-weather.sh

Code:
#!/bin/sh

/etc/init.d/framework stop
/etc/init.d/powerd stop
/mnt/us/weather/weather.sh

So in few words - how to switch it ON/OFF after it will be in cron job list...

Last edited by pacraf; 01-16-2014 at 03:19 AM.
pacraf is offline   Reply With Quote