diff --git a/sleep_weather.sh b/sleep_weather.sh index 183f49c..fc82480 100755 --- a/sleep_weather.sh +++ b/sleep_weather.sh @@ -7,7 +7,8 @@ main() while tmux has-session &> /dev/null do ./weather.sh > ~/.tmux/plugins/tmux-dracula/weather.txt - if [ (cat ~/.tmux/plugins/tmux-dracula/weather.txt | sed -n 2p) =~ ' "error": {' ]; then + error=$(cat ~/.tmux/plugins/tmux-dracula/weather.txt | sed -n 2p) + if [ $error = ' "error": {' ]; then echo "Too Many Requests" > ~/.tmux/plugins/tmux-dracula/weather.txt break fi