Is there a command I can use on windows to shutdown to SN without accessing SvrPowerControl in squeezecenter?
I know I can use c:\windows\system32\cmd.exe /C start /B scpowertool.exe --shutdown --log to shutdown the server and PC but I wish to switch to SN first.
Thanks
Results 651 to 660 of 2059
-
2009-05-07, 13:52 #651Junior Member
- Join Date
- Dec 2008
- Posts
- 8
-
2009-05-07, 19:22 #652
You can do this using SqueezeCenter's CLI. The SCCLITool.exe utility called from the following batch file would do the trick:
Shutdown2SN.cmd:
That method gives you all the advantages of SrvrPowerCtrl (i.e. alarm-wakeup scheduling, etc) but allows you to initiate the action from "outside" of SqueezeCenter...i.e. from a windows scheduled task, from a shortcut mouse click, etc.Code:@echo off rem Change the following value if not running this batch file locally on the SC machine. set ServerIP=127.0.0.1 rem Change the following value if you have changed the value for the CLI port in SC settings. set CLIPort=9090 rem Change the following value to match your players actual MAC address. set PlayerMAC=00:04:20:10:0A:0B scclitool.exe srvrpowerctrl shutdown2sn Message_to_display %PlayerMAC% -h %ServerIP% -p %CLIPort%
If you really don't want SrvrPowerCtrl involved, have your windows batch file do something like this:
Code:@echo off rem Change the following value if not running this batch file locally on the SC machine. set ServerIP=127.0.0.1 rem Change the following value if you have changed the value for the CLI port in SC settings. set CLIPort=9090 rem Change the following value to match your players actual MAC address. set PlayerMAC=00:04:20:10:0A:0B scclitol.exe %PlayerMAC% connect www.squeezenetwork.com -h %ServerIP% -p %CLIPort% scpowertool.exe --shutdown --log --wait=30
Last edited by gharris999; 2009-05-08 at 12:03.
-
2009-05-17, 10:01 #653Senior Member
- Join Date
- Apr 2008
- Location
- Paris, France
- Posts
- 1,466
A plea for srvPowerControlled-playlists
I think the web interface for serverPowerControl is great.
There are a lot of times I want to play my music and then do something with the system. Like rescan once the playlist is over, power off the player once the alarm has elapsed, etc.
For many of these actions, srvPowerControl has automated features. But now there is a web interface to the plugin and I thought I might try to pepper a playlist and see what happens.
Look at the picture I include here, you'll get the idea.
I believe that having clients/SC/server actions to drag and drop as part of a playlist would be very cool: rescanning, poweroff, switch to SN... Another control I'd love to add to a playlist is to deactivate shuffling (for album playlists), or set repeat (for alarm playlists)
BTW the playlist I created here worked exactly once before the restart action item was disregarded by SC. It refuses to "play" again the item, not so dumb :-)
This is the playlist I used:Code:#CURTRACK 0 #EXTM3U #EXTINF:-1,Ba Ba Boom /media/Externe-1/Audiotheque/Fichiers/Disco. par Volume (mp3)/Music-Mezze-21/Trojan R ock Steady Box Set Disc 3/04 Ba Ba Boom.mp3 #EXTINF:-1,Restart SC (Boom!!) http://localhost:9000/plugins/SrvrPowerCtrl/action.html?action=SCRESTART
Last edited by epoch1970; 2009-05-17 at 10:30.
-
2009-05-18, 08:25 #654
Ha! Very clever! And very cool. I'll add a set of "playlists" for this sort of thing to the next release. Thanks!
I'm a little surprised that that method doesn't run afoul of the anti-CSRF protection stuff. If you try that url in a non-squeezecenter browser session, does the anti-csrf warning get displayed?
I can see the utility of your suggestion: a "bridge" between playlists and the CLI. I agree that that would open up another helpful avenue for automating tasks. It would just take a semi-trivial enhancement to the CLI plugin to enable this: a web page and some page handling perl code....that or a new, relatively simple "cliBridge" plugin.
As to your suggestion that SrvrPowerCtrl webUI actions be drag-able to the playlist...off hand, I'm not sure how to accomplish this. I'll tack this onto the todo list for further investigation.
-
2009-05-18, 12:25 #655Junior Member
- Join Date
- Jan 2009
- Location
- Palz
- Posts
- 13
sc rights
hello, need some help/probably just a hint where to find the info!
pre info: i'm linux(ubuntu) beginner.
have managed to install SvrPowerControl - this is exactly what i've been looking for- very happy!!
showes up in the sc ui, in plugins fine.
but when i do the test:
"sudo -u squeezecenter sudo /sbin/shutdown -k -h now
"
i get a promt asking me for "[sudo] password for squeezecenter: "
probably not a good sign!?
i can gather , some right issue.
but how do i fix this? have been looking all over the place.
please help. thanks a lot
have recently updated to ubuntu 9.04SB Boom, SB3, MSI Wind PC-Ubuntu 9.04
-
2009-05-18, 14:21 #656Junior Member
- Join Date
- Mar 2008
- Posts
- 4
Re: sc rights
this post might help:
http://forums.slimdevices.com/showpo...31&postcount=3
-
2009-05-18, 16:39 #657Senior Member
- Join Date
- Apr 2008
- Location
- Paris, France
- Posts
- 1,466
I don't use the CSRF protection stuff. I just confused SCRESTART with RESTART and got my server to reboot (d'oh!!!), calling the URL from a browser I didn't use for SC to this server for hours. Maybe that's a bit too lax as a behavior; however, I don't mind living dangerously. (EDIT: confirmed: I could reboot a second time, and the server couldn't have seen a session this time
)
Right. Glad you like it. Thinking of it again, I believe there may be issues with global vs. per player actions: if we have such "centerlets" -as in droplets, servlets..- it would be a bore to have to parameterize them before the drop.I can see the utility of your suggestion: a "bridge" between playlists and the CLI. I agree that that would open up another helpful avenue for automating tasks. It would just take a semi-trivial enhancement to the CLI plugin to enable this: a web page and some page handling perl code....that or a new, relatively simple "cliBridge" plugin.
Also I guess there are sequential vs. parallel (background) processing issues: imagine you want to switch to SN and launch a DB rescan during that time. You can drop two centerlets, but if processing is strictly sequential as for a playlist, either you take off to SN and rescan when your player is back, or you stay aground until rescan has ended...
Maybe the idea won't prove practical in the end?
Given how hard I struggle with playlists and the opml editor, drag-and-drop capability (or the same controls as with a song: add, insert next, play) would be a lifesaver for me.As to your suggestion that SrvrPowerCtrl webUI actions be drag-able to the playlist...off hand, I'm not sure how to accomplish this. I'll tack this onto the todo list for further investigation.Last edited by epoch1970; 2009-05-18 at 16:44.
-
2009-05-19, 08:41 #658
Do you have CSRF protection turned off in the SC settings?
Also, SC itself does't currently support drag 'n drop from the left pane to the playlist at this point anyway. So I think I should shelve any thoughts of supporting this until SC provides a basic mechanism to do so.
I think the thing to do for now is to include "sample" one-item playlists with instructions as to how to modify with the correct parameters, e.g. player MAC, etc.
I'm not sure that this will necessarily be true. We'll have to test this.
If you have a collection of "action" playlists, e.g.
zzz Shutdown to SqueezeNetwork
zzz Switch to SN and Rescan
...etc.
..then you've got the regular controls to "play" the actions or add them to an existing playlist.
-
2009-05-19, 08:49 #659
Your settings in /etc/sudoers aren't correct.
Did you follow the instructions on the SrvrPowerCtrl help page for Ubuntu setup? Did you run the /var/lib/squeezecenter/Plugins/SrvrPowerCtrl/scripts/Debian/srvrpowerctrl-setup.sh script?
If you did, then perhaps something has changed with how Ubuntu handles sudoers since 8.10, which is the last version I tested SrvrPowerCtrl on.
I have limited bandwidth here where I live (waaaaay out in the sticks!) and so I won't be able to download the Ubuntu 9.04 ISO for a couple of weeks.
-
2009-05-19, 08:53 #660
A minor problem which bugs me:
I have Cancel/Delay time under Command Tweaks set to 15 seconds. Before, I had set the Sleep+Hold action set to "Server Power Control Menu". If I selected Shutdown SC from this menu, I got the 15 seconds cancel time. Now, however, I have changed the Sleep+Hold action to "Shutdown Server". This means the shutdown is initiated alright when I press and hold the sleep button, but the shutdown is initiated almost immediately. (In fact, there seems to be a 3 seconds delay). Shouldn't the cancel time of 15 seconds apply in this case as well?

Reply With Quote

