From: Eleanor McHugh Date: 2010-02-06T21:40:59+09:00 Subject: Re: Can ruby do a repeated Reboot test script On 6 Feb 2010, at 11:10, Mark Hobley wrote: > Ham Baba wrote: >> Just want to write a ruby script that reboots the computer for 10 >> repeated times. Is it possible? I appriciate any help. > > Ensure that your system is configured in such a manner that members of > "shutdown" can reboot the system. Create a startup script to run the rebooter > as a member of the shutdown group. From within the ruby software: create a > counter" file if one does not exist, setting the count to 10. Use the count > that the file contains. If the count is zero, then exit because the system has > already rebooted 10 times, otherwise decrement the count and "shell out" to > the reboot command. Remembering of course to explicitly flush the file buffer of the status file and sync the filesystem before performing the reboot :) Ellie Eleanor McHugh Games With Brains http://slides.games-with-brains.net ---- raise ArgumentError unless @reality.responds_to? :reason