local/bin/weather: Fall back on wget if curl is missing

master
Pierre Neidhardt 2019-01-21 13:59:53 +01:00
parent 0cd8a1acac
commit 1710cf17d0
1 changed files with 7 additions and 1 deletions

View File

@ -12,4 +12,10 @@ EOF
exit
fi
curl wttr.in/"$1"
agent=curl
agent_flags=""
if ! command -v curl >/dev/null 2>&1; then
agent=wget
agent_flags="-q -O -"
fi
$agent $agent_flags wttr.in/"$1"