Began extending "ssh keeps NAS awake"-functionality. ssh, ftp and smb work. Some refactorings to allow for more services.

Hi fritz-hh,

your manageAcpi.sh script was 99% of what I'd been looking for. Thanks for the great work. 

I added some functionality and would like to hear what you think about it.

The -s option (formerly "ssh keepawake" but I read s as "service") now works like this:

    manageAcpi -s smb,300 -s ftp,60 

Each -s option takes a service and a duration argument. Right now, only ssh, ftp and smb work but more services can be added easily. Handling of other options is unchanged.

I would like to hear your opinion on the changes so far before investing more time.

Greetings,

Urs

PS: Some more ideas on how I would improve the script...:

* Implement more services (ISCSI target, nfs, afp, rsync, unison etc.)
* Improve documentation, especially by adding examples (saves time in the forum)
* Does the usage of 1/0 for true/false conform to sh conventions? I think it's a little confusing.
* I wrote a lot of twisted eval"" code to simulate arrays. Do you think the script could be ported to bash?
* Some CL options trigger sleep, others prevent it. I'm not sure but that might be confusing to some users.