philchillbill wrote: 
> One small thing I just noticed. You use both curl and wget (which is
> valid sh for sure) but I thought curl was not installed on pCP (which is
> why wget was used as fallback) ?
> 
> In order to make the script more tolerant of the existence of other
> ngrok tunnels around your household, the search/update for the
> parameters for the relevant tunnel pCP is using can be narrowed down by
> supplying its name. See what I've done below (where I also swapped out
> curl and use two wget calls):
> 
> > 
Code:
--------------------
  >   > 
  > #!/bin/sh
  > 
  > TUNNELNAME="mediaservertunnel"
  > UUID="a84fb223c34002944701a9a70e5e82b65e01cda21b6e8914"
  > 
  > URL=https://$(wget -qO- http://localhost:4040/api/tunnels/${TUNNELNAME} | 
awk -F\"https:// {'print $2'} | awk -F\" {'print $1'})
  > DATA=[{\"name\":\"${TUNNELNAME}\",\"url\":\"${URL}\"}]
  > echo $DATA
  > RES=$(wget -qO- 
https://smartskills.tech/linking/updateNgrok.php?uuid=$UUID\&data=$DATA)
  > echo $RES
  > 
--------------------
> > 

Thank you - yes, curl is not in the basic pCP distribution, although it
is available as an Extension package in the pCP repository.  But it
certainly makes sense to use wget instead of curl in this case, because
the whole lot will then run without the need for any additional packages
- no python, no perl, no nothing - just the ngrok executable and the
script.

I'll apply your suggested changes to my script.

Given that adding this to pCP doesn't require much to be installed, I'm
planning to move it to one of my other Squeezebox-related pCP devices so
that I don't have to keep a separate one running.


------------------------------------------------------------------------
chill's Profile: http://forums.slimdevices.com/member.php?userid=10839
View this thread: http://forums.slimdevices.com/showthread.php?t=111016

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to