Alert on reported weather phenomena
[khatus.git] / bin / khatus_sensor_weather
index 340175d..371010f 100755 (executable)
@@ -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
This page took 0.019879 seconds and 4 git commands to generate.