2016-04-29 12:09:19 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "$1" = "-h" ]; then
|
2016-10-12 09:16:48 +02:00
|
|
|
cat <<EOF>&2
|
2016-04-29 12:09:19 +02:00
|
|
|
Usage: ${0##*/} [OPTIONS]
|
|
|
|
|
|
|
|
Display weather forecast.
|
|
|
|
|
|
|
|
Use '${0##*/} :help' to list all options.
|
2016-10-12 09:16:48 +02:00
|
|
|
|
2016-04-29 12:09:19 +02:00
|
|
|
EOF
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2019-01-21 13:59:53 +01:00
|
|
|
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"
|