I needed a quick way to signal back to the kickstart server that my install was done and to boot from the hard drive next time. Or, PXEboot and then fall through to booting off the hard drive. So, I wrote a quick and simple script. In the %post clause, I have:

echo "done" | telnet 192.168.200.8 46758

Here's the script:

#!/usr/bin/ruby

require 'socket'

server = TCPserver.new('0.0.0.0', 46758)
while (session = server.accept)
  text = session.gets
  puts text
  # p session.peeraddr
  addr = ""
session.peeraddr[3].split('.').each { |n| addr += sprintf("%02.2X", n.to_i) }
  p addr
  begin
    base = "/tftpboot/pxelinux.cfg/#{addr}"
    File.rename(base, base + ".done")
  rescue SystemCallError
    puts "Error occurred renaming #{base}"
  end
  session.close
end

Yeah, lots of stuff hardcoded.  Enjoy.

-- Matt
It's not what I know that counts.
It's what I can remember in time to use.
_______________________________________________
Beowulf mailing list, Beowulf@beowulf.org
To change your subscription (digest mode or unsubscribe) visit 
http://www.beowulf.org/mailman/listinfo/beowulf

Reply via email to