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
  
--------------------


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

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to