[K12OSN] Using ltspinfo to shutdown clients

Robert Arkiletian robark at gmail.com
Wed Sep 24 16:43:25 UTC 2008

On Wed, Sep 24, 2008 at 8:07 AM, george kocke <webmaster at vol.org> wrote:
> Brian Chivers wrote:
>> I was about to start writing a script to run on the server to shutdown all
>> our clients at the end of the day using ltspinfo but I thought I'd ask
>> people what they are doing for this.
>> Also if any one would like to share there scripts I'd be very appreciative
>> so I don't have to start from scratch :-)
> I wrote this script and call it from a cron job:
> #!/bin/bash
> # lounge machines
> /usr/bin/ltspinfo --host=lounge-a --shutdown
> /usr/bin/ltspinfo --host=lounge-b --shutdown
> /usr/bin/ltspinfo --host=lounge-c --shutdown
> # dhcp machines
> START=101
> END=249
> NETWORK="192.168.105."
> for i in `seq $START $END`; do
>  IP="$NETWORK$i"
>  X=`/usr/bin/ltspinfo --host=$IP --shutdown`
>  echo "$IP: $X"
> done

I warn people not to enable this feature as it's a security issue in
ltsp 4.x. However, george, if you do use it I would put in a time
interval for each powerdown becuase the  loop to issue powerdown runs
very quickly. So it's effectively like having 30 people hit power off
button at the same time. That could cause a power surge (maybe it's
called spike) for equipment still up and may potentially damage

A 1 second interval (sleep 1s) should be sufficient.

Robert Arkiletian
Eric Hamber Secondary, Vancouver, Canada
Fl_TeacherTool http://www3.telus.net/public/robark/Fl_TeacherTool/
C++ GUI tutorial http://www3.telus.net/public/robark/

More information about the K12OSN mailing list