scripts

unixus scriptus
git clone https://s.sonu.ch/~roket1428/scripts.git
Log | Files | Refs

wttr-old (298B)


      1 #!/bin/sh
      2 
      3 # Get weather information from wttr.in 
      4 
      5 # change it to your city
      6 city=""
      7 
      8 curl -so "$XDG_CACHE_HOME"/weather "https://wttr.in/${city}?format=3"
      9 
     10 if [ -z "$(grep "Unknown" "$XDG_CACHE_HOME"/wttrold )" ]; then
     11 	
     12 	echo "wttr.in down"
     13 else
     14 	sed -e 's/^.*\ //' "$XDG_CACHE_HOME"/wttrold
     15 fi
     16