I've been trying to code what I wanted and I came up with this. I guess it will look funny to anyone actually any good with perl :) Suggestions entierly welcome.
The server will shutdown if: - none of the players have been playing for a certain time - the server is not scanning the music library - a specified process is not running (works with ssh, should work for telnet or ftp too, I reckon) It's quite different from Maxs version in that it doesn't shut down when no player happens to be playing at the very moment the script is running, but tries to keep a bit of history in a file. It therefore needs to run more regularly. To me it does seem like a fairly heavy script to run so often. (Is it?) I'd like to add the possibility to not shut the server down within say 30 minutes after it was started (to avoid: WOL server, go make coffee, forget about server a bit, come back and find its shut down again). That seems pretty obvious with 'uptime', but I don't think that would work with a suspended/resumed system. If possible I'd also like to avoid writing the status file to disk, but I'm not sure how to store stuff in environment variables if that's at all possible and good form. +-------------------------------------------------------------------+ |Filename: slimmonitor.pl.txt | |Download: http://forums.slimdevices.com/attachment.php?attachmentid=456| +-------------------------------------------------------------------+ -- Roger the Shrubber _______________________________________________ unix mailing list [email protected] http://lists.slimdevices.com/lists/listinfo/unix
