AndyTaylorTweet / Pi-Star_v4_Binaries_Bin

Repository for Pi-Star Binaries
http://www.pistar.uk
25 stars 16 forks source link

Console LastHeard bash script to codebase #5

Closed shaposhnikoff closed 3 years ago

shaposhnikoff commented 3 years ago

Hello, i think this ls small issue, so i'm not creating a PR, put it here

#!/bin/bash
# created by Max I. Shaposhnikov
# shaposhnikoff@gmail.com

clear
while true; do
  curl -s http://localhost/api/last_heard.php |\
  jq -r '"Callsign\tTransmit time\tMode\tTarget\tDuration",
 "---\t---\t---\t---\t---",
(.[]|"\(.callsign)\t\(.time_utc)\t\(.mode)\t\(.target)\t\(.duration)" )'|
 column -t -s $'\t'

sleep 3
clear
done

updated every 3 seconds, very small and useful. Need only jq ( https://stedolan.github.io/jq/ ) for run, and bash

and this is output

Callsign    Transmit time        Mode        Target                Duration
---         ---                  ---         ---                   ---
K5ADS-ALAN  2021-05-10 20:11:47  YSF         ALL at K5ADS
KM6ZPO      2021-05-10 20:11:44  YSF         ALL                   35.1
KG2MS       2021-05-10 20:10:22  YSF         ALL                   6.6
KN4DDD      2021-05-10 20:09:38  YSF         ALL                   3.0
WA2UBH      2021-05-10 20:09:32  YSF         ALL                   62.5
KA3ZBA      2021-05-10 20:03:24  YSF         *****EA8Gi at KA3ZBA  41.4
UT3UDX-RPT  2021-05-10 20:01:53  YSF         ALL                   0.6
25501       2021-05-10 19:53:43  DMR Slot 1  TG 25501              12.8
N7MKY-FT3   2021-05-10 19:27:04  YSF         ALL                   41.1
KO4IPV      2021-05-10 19:25:10  YSF         ALL at YCS530-37      56.8
PD4HMB      2021-05-10 19:24:34  YSF         ALL at PD4HMB         0.4
2E0EJJ      2021-05-10 19:20:17  YSF         ALL                   1.1
VK3PLA      2021-05-10 19:19:38  YSF         ALL                   1.4
KB1AWZ      2021-05-10 19:15:57  YSF         ALL                   1.2
DF3UM       2021-05-10 19:13:55  YSF         ALL                   0.6
YU2DVD      2021-05-10 19:13:16  YSF         ALL at YU0UPI         0.2
KG6PX       2021-05-10 19:12:34  YSF         ALL at KG6PX          0.4
2E0ODJ      2021-05-10 19:11:15  YSF         ALL at 2E0ODJ         0.2
2E0GYR      2021-05-10 19:09:23  YSF         ALL at GB3HB          0.2
K2MTB       2021-05-10 19:08:43  YSF         ALL at K2MTB          3.9
K5MPH       2021-05-10 19:08:39  YSF         ALL                   10.4
N2FGB       2021-05-10 19:07:32  YSF         ALL                   3.1
DO1LPH      2021-05-10 19:05:54  YSF         ALL                   0.4
KE8DKP      2021-05-10 19:03:06  YSF         ALL                   1.2
K8AGN-LARY  2021-05-10 19:00:25  YSF         *****H5DJ1            0.9
VE1CMD      2021-05-10 18:59:37  YSF         ALL                   1.5
KC9QCJ      2021-05-10 18:57:35  YSF         ALL                   0.5
LU7CFV-991  2021-05-10 18:56:56  YSF         ALL                   0.4
WA0UAY      2021-05-10 18:53:25  YSF         ALL                   3.5
N2GWK       2021-05-10 18:52:07  YSF         ALL at N2GWK          0.2
UZ5DU       2021-05-10 18:45:58  DMR Slot 1  TG 255                2.8
K3MBN       2021-05-10 18:44:54  YSF         ALL at K3MBN          3.5
K2GOD       2021-05-10 18:42:08  YSF         ALL                   2.3
K5WRS       2021-05-10 18:35:58  YSF         *****FAW9S            0.9
W6IC        2021-05-10 18:31:22  YSF         ALL at W6IC           0.2