diff options
author | Asa Venton <asav1410@gmail.com> | 2020-10-31 06:00:51 +0000 |
---|---|---|
committer | Asa Venton <asav1410@gmail.com> | 2020-10-31 06:00:51 +0000 |
commit | bba45062f265a373d21f121ca2cb5029f1fab034 (patch) | |
tree | 372cd001f7fe025345eb6370e97a68fc25f527c9 | |
parent | 6b2fe83d7d8ff6567ab8799afb7fdd97dc723866 (diff) |
Add support for actual takeoff and landing times in _arrivals and _departures.
-rwxr-xr-x | flightquery.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/flightquery.sh b/flightquery.sh index 5379b91..bb4ed2c 100755 --- a/flightquery.sh +++ b/flightquery.sh @@ -68,15 +68,20 @@ _flight() { origin=$(echo $result | jq -r '.data[0].departure.iata') takeoffSched=$(echo $result | jq -r '.data[0].departure.scheduled') takeoffEst=$(echo $result | jq -r '.data[0].departure.estimated') + takeoffActual=$(echo $result | jq -r '.data[0].departure.actual') takeoffDelay=$(echo $result | jq -r '.data[0].departure.delay') destination=$(echo $result | jq -r '.data[0].arrival.iata') landingSched=$(echo $result | jq -r '.data[0].arrival.scheduled') landingEst=$(echo $result | jq -r '.data[0].arrival.estimated') + landingActual=$(echo $result | jq -r '.data[0].arrival.actual') landingDelay=$(echo $result | jq -r '.data[0].arrival.delay') - # Build output string giving estimated times and delays where available. + # Build output string giving actual or estimated times and delays where available. output="$airline - Origin: $origin " - if [[ "$takeoffEst" != "null" ]] + if [[ "$takeoffActual" != "null" ]] + then + output="$output $takeoffActual" + elif [[ "$takeoffEst" != "null" ]] then output="$output $takeoffEst" else @@ -89,8 +94,10 @@ _flight() { fi output="$output Dest: $destination" - - if [[ "$landingEst" != "null" ]] + if [[ "$landingActual" != "null" ]] + then + output="$output $landingActual" + elif [[ "$landingEst" != "null" ]] then output="$output $landingEst" else |