danco;476042 Wrote: 
> I think it must be either something silly by me, or something basic by
> you. Because the fact that the script does not even get retained as an
> item suggests that it is more than a kink. If it was retained and
> appeared in the menu but did not work I would then suspect a kink.
> 
> I have tried resetting to default before trying to include the script,
> but it does not help.
> 
> Custom label is
> 
> disable sleep
> 
> full path to script is
> 
> /Users/danco/Library/Application\ Support/Squeezebox/scripts/caffeine\
> on\ 2 
> 
> 
> The script is
> 
> #! /bin/bash
> open /Applications/D\'s\ utils/caffeine\ on.app
> 
> 
> And caffeine on
> 
> is an AppleScript application
> 
> let me know if you need anything more.
Ok, the latest check in at
http://srvrpowerctrl.googlecode.com/svn/SrvrPowerCtrl_20091022.zip
starts to incorporate PeterW's parsing code from KidsPlay.  This means
that you can have command lines with spaces or with escaped characters
saved in the prefs and they'll be executed correctly.

My test script:

"/var/tmp/some folder name/another folder name with spaces/some script
file.sh"

Code:
--------------------
    
  #!/bin/sh
  datestr=`date`
  logfile='/var/log/squeezeboxserver/server.log'
  echo "$0, $1, at $datestr" >>$logfile
  
--------------------

My custom command label: Test command

The custom command:

Code:
--------------------
    
  /var/tmp/some\ folder\ name/another\ folder\ name\ with\ spaces/some\ script\ 
file.sh "cmd line arg"
  
--------------------


Results in server.log of running this command from the WebUI:

Code:
--------------------
    
  [09-10-22 23:50:58.0013] Plugins::SrvrPowerCtrl::Util::SystemExecCmd (607) 
Now trying to execute /var/tmp/some\ folder\ name/another\ folder\ name\ with\ 
spaces/some\ script\ file.sh "cmd line arg"
  /var/tmp/some folder name/another folder name with spaces/some script 
file.sh, cmd line arg, at Thu Oct 22 23:50:58 EDT 2009
  [09-10-22 23:50:58.0162] Plugins::SrvrPowerCtrl::Util::SystemExecCmd (625) 
Command returned 0
  
--------------------

So...it works.  For me, anyway.


-- 
gharris999
------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=48521

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

Reply via email to