diff --git a/sleep_weather.sh b/sleep_weather.sh index e2088e1..71e0174 100755 --- a/sleep_weather.sh +++ b/sleep_weather.sh @@ -4,10 +4,14 @@ main() { - while true + while tmux has-session &> /dev/null do ./weather.sh > ~/.tmux/plugins/tmux-dracula/weather.txt - sleep 600 + if [ (cat ~/.tmux/plugins/tmux-dracula/weather.txt | tail -1) = } ]; then + echo "Too Many Requests" > ~/.tmux/plugins/tmux-dracula/weather.txt + break + fi + sleep 1000 done }