projects
/
grml-etc-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release new version 0.19.7
[grml-etc-core.git]
/
usr_share_grml
/
zsh
/
functions
/
weather
diff --git
a/usr_share_grml/zsh/functions/weather
b/usr_share_grml/zsh/functions/weather
index
44a87e1
..
bf303bf
100644
(file)
--- a/
usr_share_grml/zsh/functions/weather
+++ b/
usr_share_grml/zsh/functions/weather
@@
-3,7
+3,7
@@
emulate -L zsh
emulate -L zsh
-if [[ -
n
"$1" ]]; then
+if [[ -
z
"$1" ]]; then
print 'Usage: weather <station_id>'
print \
'List of stations: http://en.wikipedia.org/wiki/List_of_airports_by_ICAO_code'
print 'Usage: weather <station_id>'
print \
'List of stations: http://en.wikipedia.org/wiki/List_of_airports_by_ICAO_code'
@@
-17,7
+17,7
@@
local PLACE="${1:u}"
local DIR="${HOME}/.weather"
local LOG="${DIR}/log"
local DIR="${HOME}/.weather"
local LOG="${DIR}/log"
-if [[ -d ${DIR} ]]; then
+if
!
[[ -d ${DIR} ]]; then
print -n "Creating ${DIR}: "
mkdir ${DIR}
print 'done'
print -n "Creating ${DIR}: "
mkdir ${DIR}
print 'done'
@@
-27,7
+27,7
@@
print "Retrieving information for ${PLACE}:"
print
cd ${DIR} && \
wget -T 10 --no-verbose --output-file=$LOG --timestamping \
print
cd ${DIR} && \
wget -T 10 --no-verbose --output-file=$LOG --timestamping \
- http
://weather.noaa.gov/pub
/data/observations/metar/decoded/$PLACE.TXT
+ http
s://tgftp.nws.noaa.gov
/data/observations/metar/decoded/$PLACE.TXT
if [[ $? -eq 0 ]]; then
if [[ -n "$VERBOSE" ]] ; then
if [[ $? -eq 0 ]]; then
if [[ -n "$VERBOSE" ]] ; then