My suggestion is in the script.

The following is my version which just creates lots of output to shows
which parts of script are executed.
Squeezelite V1.9.7-1283 was tested on a Rasbian Buster  
Squeezelite is standard Ralphy and has GPIO build option.
Run from command line with "-S /home/pi/myscript.sh"


Code:
--------------------
    
  #!/bin/sh
  
#----------------------------------------------------------------------------------------
  # Script for turning RPi3 USB output on/off when Squeezelite player is turned 
on/off.
  # This script requires that extension uhubctl.tcz is installed.
  # Enter the path to this "Power On/Off Script" on the pCP Squeezelite 
Settings page.
  # https://github.com/mvp/uhubctl#raspberry-pi-b2b3b
  
#----------------------------------------------------------------------------------------
  # squeezelite -S /home/tc/usb-power-on-off.sh
  # 
  # squeezelite sets $1 to:
  #     0: off
  #     1: on
  
#----------------------------------------------------------------------------------------
  NOW=$(date +"%m-%d-%Y %T")
  echo "---  $NOW ---" >>/tmp/powerlog.txt
  echo "Args: " "$@" >>/tmp/powerlog.txt
  case $1 in
  0) echo "Arg dollar 1 value 0 " >>/tmp/powerlog.txt ;;
  1) echo "Arg dollar 2 value 1 " >>/tmp/powerlog.txt ;;
  esac
  
  echo "---- End run ---- " >>/tmp/powerlog.txt
  
--------------------

Toggling power button on WebUI for player

Code:
--------------------
    
  ---  11-15-2020 11:49:12 ---
  Args:  0
  Arg dollar 1 value 0 
  ---- End run ---- 
  ---  11-15-2020 11:49:12 ---
  Args:  1
  Arg dollar 2 value 1 
  ---- End run ---- 
  ---  11-15-2020 11:49:13 ---
  Args:  0
  Arg dollar 1 value 0 
  ---- End run ---- 
  ---  11-15-2020 11:49:13 ---
  Args:  1
  Arg dollar 2 value 1 
  ---- End run ---- 
  
--------------------


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=112760

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

Reply via email to