gharris999;593572 Wrote: 
> One question: in sbplayer_inactive, you are using /usr/bin/expect as the
> shell.  Is expect a normal part of OSX, or are you using an installed
> port of expect?

Expect is standard issue in OSX 10.4 & 10.5, and Apple's website
implies that it is also standard issue in 10.3 and 10.6. No installed
port required.
The script runs on both 10.4 & 10.5 without modification.

gharris999;593572 Wrote: 
> Could nc be used rather than expect and telnet to make this a little
> more lightweight?  I'm guessing not, if the user is requiring login
> credentials on the cli.

I have no doubt that the script could be made much more lightweight,
perhaps along the lines you suggest.

Some thoughts:

The script only runs when the system is actually attempting to sleep.
Chances are that the system is either:

(a) not obviously doing much at that point (certainly no user at the
keyboard), in which case it will simply go to sleep, or

(b) there is a player serving up music to someone who is nowhere near
the keyboard. :)
In this latter case the script might be hammering away every 2/3
minutes or so. But do we care ?


The system requires that the sleepwatcher/sbplayer_inactive combination
complete within about 10/15 seconds or so. I forget the exact number.
The authors of expect kindly give a timeout option, so I have not had
to code up anything to deal with that.


I don't think the log-in credentials would cause any problem, at least
not the way the server is currently implemented.
The server happily accepts a "dummy" user/password submission when
authentication is disabled, and responds just the same as it would to
regular authentication.
So I have the script log itself in every time. Same code but with a
nonsense user/password combo unless the script is edited.


More of a concern might be the storage of the password in the script.
It's clear text. I don't think there's much I can do about that, but I
might be wrong.
My server is not currently accessible from outside my network, and I
have no need to require authentication, so I haven't pursued the
point.


Why use expect ? I recycled an existing, sufficiently complex, remote
log-in script that I had to hand.
Not one line of that script remains in sbplayer_inactive, and it took
rather longer to do than the original 90 minutes that I allotted.


-- 
mrw
------------------------------------------------------------------------
mrw's Profile: http://forums.slimdevices.com/member.php?userid=38299
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