On 12/10/2009 08:43 PM, Mike Pfaiffer wrote:
I'm sure this will be of no interest to the "*NIX heavyweights" of the group. For everybody else here is the code I plan to add to the machine...
rm -rf /home/guest cp /root/guest.tar /home cd /home tar -xvf guest.tar rm guest.tar cd - echo 'zenity --info --display=:0.0 --text="This computer will automatically turn off in five minutes." --width=150' | at now +25 minutes echo 'shutdown -h now' | at now +30 minutes
You could replace lines 2-6 in that script with:
tar xf /root/guest.tar -C /home
No need to do the cd's and cp/rm, as tar can do the cd and the cp is unnecessary. You don't really need the v option to tar if this is running from rc.local. You could also save a little space by using the z argument to tar (for both the create and extract phases) and storing the home directory copy in guest.tgz.