lxtmux/scripts/sleep_weather.sh

27 lines
453 B
Bash
Raw Normal View History

2020-04-29 16:35:35 +01:00
#!/usr/bin/env bash
#wrapper script for running weather on interval
2020-04-29 19:33:51 +01:00
fahrenheit=$1
main()
{
2020-03-16 06:15:26 +00:00
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
$current_dir/weather.sh > $current_dir/../data/weather.txt
2020-03-16 00:20:04 +00:00
while tmux has-session &> /dev/null
do
2020-04-29 19:33:51 +01:00
$current_dir/weather.sh $fahrenheit > $current_dir/../data/weather.txt
2020-03-15 19:59:20 +00:00
if tmux has-session &> /dev/null
then
2020-03-31 20:13:42 +01:00
sleep 1200
2020-03-15 19:41:10 +00:00
else
break
fi
done
}
#run main driver function
main