So I had this crazy idea of slapping my current connection information in to a format I could embed it in some of my other pages/profiles. Since I'd done some work a couple years ago scraping information from Pi-Star dashboard for some APRS-IS stuff; I decided to just stick with that general idea. Unlike my previous stuff that ran a bash script on pi-star and required some additional stuff; this runs on the webserver and now requires absolutely nothing special except access to the pi-star dashboard.
This is making the assumption that you self-host a webserver. You can probably do this using remote access to the dashboard depending on your level of paranoia. So far all I have working is the bash script portion:
Code: Select all
#!/bin/bash #.006 alpha dmr=$(curl -s http://192.168.1.10/mmdvmhost/bm_links.php| sed 's/<[^>]\+>/\n/g' | grep '^TG' | sed 's/TG/#/g'| sed 's/(.)//g' | sed ':a;N;$!ba;s/\n/ /g') [ -z "$dmr" ] && dmr="No Talkgroups Found" dstar=$(curl -s http://192.168.1.11/mmdvmhost/repeaterinfo.php | egrep "REF|XRF|DCS|XLX" | sed 's/<[^>]\+>//g' | sed 's/L/l/'| cut -b 1-8) [ -z "$dstar" ] && dstar="Not Linked" printf "%s\n" "BM TG: $dmr" printf "%s\n" "DStar: $dstar"
Same thing for DStar....except we just egrep for a reflector prefix, strip the HTML, and cut the protocol (i.e "DPlus/OUT"). This is hacky. If you happen to connect to a repeater directly and not a reflector; it won't register. That's something I'm going to work on. But since 99.9% of my activity is on a reflector....this will work. Again...if I'm not linked to a reflector a message is used instead.
Code: Select all
[email protected]:/media/html/qth-nq4t$ ./hotspots.sh BM TG: #3151 #98003 DStar: DCS216 E [email protected]:/media/html/qth-nq4t$ ./hotspots.sh BM TG: #3151 #98003 DStar: Not Linked [email protected]:/media/html/qth-nq4t$ ./hotspots.sh BM TG: No Talkgroups Found DStar: DCS216 E [email protected]:/media/html/qth-nq4t$ ./hotspots.sh BM TG: No Talkgroups Found DStar: Not Linked
Update: I apparently forgot to update nginx config for this server directive when I upgraded PHP. https://qth.nq4t.com/hotspots.php now actually displays some text.
73 de Jay/NQ4T