Grab wifi status from iwconfig instead of nmcli
[khatus.git] / bin / khatus_sensor_weather
CommitLineData
f37162a4
SK
1#! /bin/sh
2
3set -e
4
5weather_station_id="$1"
6
7metar -d "$weather_station_id" 2>&1 \
8| awk '
9 /METAR pattern not found in NOAA data/ {
10 failures++
11 }
12
13 /^Temperature/ {
14 celsius = $3;
15 fahrenheit = (celsius * (9 / 5)) + 32;
16 temperature = fahrenheit
17 }
18
19 END {
20 if (failures > 0) {
21 temperature = "--"
22 }
23 print temperature "°F"
24 }'
This page took 0.02389 seconds and 4 git commands to generate.