summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2023-01-05 01:19:27 +0100
committerlassulus <lassulus@lassul.us>2023-01-05 01:19:27 +0100
commit727ef7fa8e4581ebf3c792b6f9ff7fba6c8504dd (patch)
treec0622f1f54929f6e0779658bafdbaae2a9bd6c1d
parent0bbbfe153a0752bbe337bef1bac8c52aa285d4da (diff)
l radio weather: unique ips
-rw-r--r--lass/2configs/radio/weather.nix13
1 files changed, 8 insertions, 5 deletions
diff --git a/lass/2configs/radio/weather.nix b/lass/2configs/radio/weather.nix
index 704bf7218..ad96d8ec0 100644
--- a/lass/2configs/radio/weather.nix
+++ b/lass/2configs/radio/weather.nix
@@ -18,11 +18,14 @@ let
MAXMIND_GEOIP_DB="/tmp/GeoLite2-City.mmdb"; export MAXMIND_GEOIP_DB
OPENWEATHER_API_KEY=$(cat "$CREDENTIALS_DIRECTORY/openweather_api"); export OPENWEATHER_API_KEY
ss -no 'sport = :8000' |
- jc --ss | jq -r '.[] |
- select(
- .local_address != "[::ffff:127.0.0.1]"
- and .local_address != "[::1]"
- ) | .peer_address | gsub("[\\[\\]]"; "")
+ jc --ss | jq -r '
+ [
+ .[] |
+ select(
+ .local_address != "[::ffff:127.0.0.1]"
+ and .local_address != "[::1]"
+ ) | .peer_address | gsub("[\\[\\]]"; "")
+ ] | unique[]
' |
${weather_for_ips}/bin/weather_for_ips
'';