[slim] Re: SlimServer Command Interface?
Many thanks for that (I should have looked harder). I can use the CLI interactively by telnet to the host/port 9090 and run a command like playerid power ? and see the response. But how can I do this from a bash script? Is there a UNIX command I can use to send the CLI command to Slimserver and read the reply? Thanks for any pointers. -- Niss Niss's Profile: http://forums.slimdevices.com/member.php?userid=7863 View this thread: http://forums.slimdevices.com/showthread.php?t=28403 ___ discuss mailing list discuss@lists.slimdevices.com http://lists.slimdevices.com/lists/listinfo/discuss
[slim] Re: SlimServer Command Interface?
Niss;143983 Wrote: To hibernate my PC running SlimServer, and save power when no Squeezebox is using it, I would like to write a script that checks periodically then hibernates the machine if no activity for a set length of time. (Running on Linux Fedora Core 5.) Hibernate from command line works fine using Suspend2, and the squeezebox wakes the PC up (Wake on LAN) from hibernate when turned on by the remote. But what I am lacking is a way that I can check from a bash script whether any player is using the squeezebox -- is there any command interface to Slimserver? Would appreciate any information or advice. How many Squeezeboxes do you have? In particular, how much physical checking would you need to do to ensure that no SB is streaming anything? I can appreciate that you may not want to hibernate your machine by physically going to it - it may be in a different part of the house. But what I am thinking of is that you can use the Execute Script plugin to hibernate the computer from a Squeezebox, but I'm not sure if that's still too incovenient for you. -- danco danco's Profile: http://forums.slimdevices.com/member.php?userid=210 View this thread: http://forums.slimdevices.com/showthread.php?t=28403 ___ discuss mailing list discuss@lists.slimdevices.com http://lists.slimdevices.com/lists/listinfo/discuss
[slim] Re: SlimServer Command Interface?
I have 2 squeezeboxes but will add more. I am planning to have a routine that runs periodically on the server to check whether any of the SBs is running, but also the server runs SAMBA, serving other PCs for file/print serving, so the routine would also need to check whether any client connections are in use before hibernating. So the problem with initiating the power off manually from a Squeezebox is that it might cut off a SAMBA connection, also it relies on remembering to do it. The CLI and the playerid power ? command would seem to be a good answer, just that I don't know how to use the CLI (and read the reply) from a bash script. -- Niss Niss's Profile: http://forums.slimdevices.com/member.php?userid=7863 View this thread: http://forums.slimdevices.com/showthread.php?t=28403 ___ discuss mailing list discuss@lists.slimdevices.com http://lists.slimdevices.com/lists/listinfo/discuss
Re: [slim] Re: SlimServer Command Interface?
On 10/8/06, Niss [EMAIL PROTECTED] wrote: Many thanks for that (I should have looked harder).I can use the CLI interactively by telnet to the host/port 9090 and run a command likeplayeridpower ? and see the response.But how can I do this from a bash script? Is there a UNIX command I canuse to send theCLI command to Slimserver and read the reply? Thanks for any pointers.Use expect.#!/usr/bin/expectset timeout 3spawn -noecho /bin/bashexpect -re $ send telnet myserver:9090\n expect -re Escape charactersend player power ?\nset results $expect_out(buffer)if {$result -re 1} then { send player power off\n expect off send exit\n expect eof} else { send exit\n expect eof}That ought to get you started -- I'm probably not remembering the right syntax for the regular _expression_ in the if statement, so google how to do those. -- I spent all me tin with the ladies drinking gin,So across the Western ocean I must wander -- traditional ___ discuss mailing list discuss@lists.slimdevices.com http://lists.slimdevices.com/lists/listinfo/discuss
[slim] Re: SlimServer Command Interface?
I have 2 squeezeboxes but will add more. I am planning to have a routine that runs periodically on the server to check whether any of the SBs is running, but also the server runs SAMBA, serving other PCs for file/print serving, so the routine would also need to check whether any client connections are in use before hibernating. I'm using netstat from a shell script for that. The script calls netstat at regular intervals (2 minutes at present), resetting a timeout if there are inet connections which don't match a predefined list of don't-care services. There's a fixed connection showing up on netstat for any connected Squeezebox, so it's an easy task to not shut down before all of them are down. Similarly, any connected PC (member of the same workgroup) is represented by a netbios connection. It might be trickier to watch them for activity - shorter monitor intervals should do in most cases. === Just a sidenote: I'm using the mailing list interface, and my replies semm not to go through. The address seems to be correct: 2006-10-07 19:09:53 1GWFfQ-0004q0-FM = discuss@lists.slimdevices.com R=smarthost T=remote_smtp_smarthost Anyone else having that problem? -- hczim hczim's Profile: http://forums.slimdevices.com/member.php?userid=6380 View this thread: http://forums.slimdevices.com/showthread.php?t=28403 ___ discuss mailing list discuss@lists.slimdevices.com http://lists.slimdevices.com/lists/listinfo/discuss
[slim] Re: SlimServer Command Interface?
Try home - help - technical information - command line interface Or various threads on CLI (if searching remember you need 4 characters so search for CLI*) Ceejay -- ceejay ceejay's Profile: http://forums.slimdevices.com/member.php?userid=148 View this thread: http://forums.slimdevices.com/showthread.php?t=28403 ___ discuss mailing list discuss@lists.slimdevices.com http://lists.slimdevices.com/lists/listinfo/discuss