passed arg, weather always redl

This commit is contained in:
Luke Smith 2019-05-02 17:42:48 -04:00
parent 9fd2f8cb4d
commit b79ac88a2d

View file

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
location="$1"; [ -z "$location" ] || location="$location+" location="$1"; [ -z "$location" ] || location="$location+" && rm -f "$HOME/.local/share/weatherreport"
getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1 getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1
curl -s "wttr.in/$location" > "$HOME/.local/share/weatherreport" || exit 1 ;} curl -s "wttr.in/$location" > "$HOME/.local/share/weatherreport" || exit 1 ;}
@ -17,7 +17,7 @@ case $BLOCK_BUTTON in
🌞: Daily high" ;; 🌞: Daily high" ;;
esac esac
if [ "$(stat -c %y "$HOME/.local/share/weatherreport" | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] if [ "$(stat -c %y "$HOME/.local/share/weatherreport" >/dev/null 2>&1 | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ]
then getforecast && showweather then getforecast && showweather
else showweather else showweather
fi fi