Ok, as promised:

First, create the following file in: /opt/ltsp/i386/usr/sbin/reboot.sh

---- snip below ----

#!/bin/sh

set -e

RBFILE=/etc/rebootpass

# If $RBFILE doesn't exist, exit
[ -f "${RBFILE}" ] || exit

PERM=$(stat -c "%a" "${RBFILE}")
[ "${PERM}" = "600" ] && RBPASS=$(cat "${RBFILE}") || exit

while :; do
    PASS=$(nc -l -p 9200 | tr -d '\r\n')
    [ "${PASS}" = "${RBPASS}" ] && /sbin/poweroff -fp
done


---- snip above ----

chmod 755 it, so it's executeable.

echo "foople" > /opt/ltsp/i386/etc/rebootpass
chmod 600 /opt/ltsp/i386/etc/rebootpass

Then, add the following line to /opt/ltsp/i386/etc/rc.local, above the
exit 0 line:

start-stop-daemon --start -b --exec /usr/sbin/reboot.sh

make sure rc.local gets run:

cd /opt/ltsp/i386/etc/rc2.d
mv K99rc.local S99rc.local

And boot your terminal.

Now:

echo "foople" | nc -q 0 <workstationip> 9200

should shutdown the box.

Quick, dirty, gets the job done.

Scott

-- 
Scott L. Balneaves | "Eternity is a very long time,
Systems Department |  especially towards the end."
Legal Aid Manitoba |    -- Woody Allen

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to