aboutsummaryrefslogtreecommitdiff
path: root/templates/.bin/taf
blob: f7047d7edd1f23850ea5970d4ad756e58786fd28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

jq="/usr/bin/jq"
if [[ ! -x "$jq" && -x "/usr/local/bin/jq" ]]; then
  jq="/usr/local/bin/jq"
fi

station=$(echo -n "$1" | tr "a-z" "A-Z")
token=$(pass show avwx-token)
json=$(curl -s -H "Authorization: ${token}" "https://avwx.rest/api/taf/${station:-KBOS}")
echo "$json" | "$jq" --raw-output '.raw' 2>&1