PDA

View Full Version : command line help



stinkingpig
2008-06-11, 11:46
Hey,

I'm trying to pause two players with a cron job. I've used a Perl LWP script:


#!/usr/bin/perl
use LWP::Simple;
my $1_url = "http://127.0.0.1:9000/settings/status.txt?p0=pause&p1=1&player=31:14:21:14:87:39;cauth=redacted";
my $1_status = get $1_url;
print $1_status;
my $2_url = "http://127.0.0.1:9000/settings/status.txt?p0=pause&p1=1&player=00:04:20:05:59:be;cauth=redacted";
my $2_status = get $2_url;
print $2_status;


Both URLs work in a browser... but in the script, only the second player is ever affected. Any ideas? Thanks,

GlenL
2008-06-11, 12:05
Wild stab in the dark .... have you tried pausing a few seconds between each get ?
I'm thinking it may be a timing issue of some sort.

stinkingpig
2008-06-11, 12:10
Yeah, I tried that, and I tried separating the commands into two scripts in case there was some sort of browser ID issue... no soap.

radish
2008-06-11, 12:21
When you say only one player is affected, do you mean both queries pause the same player, or one of them has no affect at all?

stinkingpig
2008-06-11, 16:35
Both queries pause player 1.

Here's output of those print statements:

Paused (53 of 78)
53
Paused (53 of 78)
53

mherger
2008-06-11, 23:12
> I'm trying to pause two players with a cron job. I've used a Perl LWP
> script:

Better take a look at the CLI (doc available from SC's help section): you
can send simple commands using netstat or something to SC.

Michael

stinkingpig
2008-06-12, 07:42
That seems like it will work better, certainly simpler. I've got this in crontab now:

30 22 * * * echo 31:14:21:14:87:39 pause 1 | nc localhost 9090 -w 1
30 22 * * * echo 00:04:20:05:59:be pause 1 | nc localhost 9090 -w 1

Let's see how it goes tonight...

And, it worked fine. Thanks!!