From 9d52c3c944cf1d5803901432f21cb578ec403e85 Mon Sep 17 00:00:00 2001 From: Jay Moore Date: Mon, 9 May 2022 02:23:51 -0400 Subject: [PATCH] Add remote execution in README --- README.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 91d5134..19539a7 100644 --- a/README.md +++ b/README.md @@ -36,15 +36,12 @@ To use this you must meet the following conditions: ``` You must have a web-server running PHP +You must be able to execute local shell scripts Your web-server must be able to access your hotspot dashboard +-or- +Your server needs SSH to a machine that can talk to dashboards. ``` -It may be possible to run this with everything on a different network without -having to expose your hotspots. A VPN could provide a way for your remote www -server to access dashboards. Running the script remotely and having your web- -server get results via SSH is another possiblity. I'll script this when I get a -chance. - You will need to load hotspot.sh and edit the hostname information. You will also need to configure if you're using D-Star or DMR. DMR scrapes the bm_links.php while Dstar scrapes repeaterinfo.php's "Linked To" box. It @@ -54,6 +51,23 @@ need to modify the script or wait for me to support it. Place hotspots.php in a document root and edit it to match where you put your shell script. Simply loading hotspots.php is all you need to do. +It is entirely possible to run this on a web-server outside of your network +with some additional tinkering. One way is make your hotspot dashboard public +and accessible over the internet. If you don't want to do that then it is +possible to execute the shell script remotely: + +``` +dewdude@pickmy:~# ssh -p [REDACTED] dewdude@qth.nq4t.com 'bash -s < /home/dewdude/pistarscrape/hotspots.sh' +BM TG: +#3151 - #8802 - #31514 - #98003
+``` + +I told my remote VPS to make an SSH connection to home and execute the script. +It executed, sent output, and terminated the SSH connection. Nothing cares if +you use VPN to scrape dashboards or remote SSH. Just as long as the bash script +can talk to the dashboard and the PHP gets that output from the script. You +could bounce it around numerous VPNs and relays and it'd be fine. + ## Testing/Troubleshooting You can easily test both parts of this script to check that the output is