X-Git-Url: https://git.xandkar.net/?p=khatus.git;a=blobdiff_plain;f=bin%2Fkhatus_sensor_weather;h=371010f1660c20d81915c5143311aaafe544729b;hp=340175d607bbc082cce00539b21c2de37399afa2;hb=654ea6e2ddf5986f1975cd860575248c114102fe;hpb=b4612a8afc54fdba4622309e085f6cbff80d44ee diff --git a/bin/khatus_sensor_weather b/bin/khatus_sensor_weather index 340175d..371010f 100755 --- a/bin/khatus_sensor_weather +++ b/bin/khatus_sensor_weather @@ -2,23 +2,7 @@ set -e -weather_station_id="$1" +dir_bin="$1" +weather_station_id="$2" -metar -d "$weather_station_id" 2>&1 \ -| awk ' - /METAR pattern not found in NOAA data/ { - failures++ - } - - /^Temperature/ { - celsius = $3; - fahrenheit = (celsius * (9 / 5)) + 32; - temperature = fahrenheit - } - - END { - if (failures > 0) { - temperature = "--" - } - print temperature "°F" - }' +metar -d "$weather_station_id" 2>&1 | "$dir_bin"/khatus_parse_metar_d_output