#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. # This bit will launch the autoconfiguration routine when it's needed # i.e. if the MAC address does not match the golden client, and the hostname is nordx-image GOLDENCLIENTMACADDRESS="00:16:76:B8:A3:1F" test `ifconfig | grep -c $GOLDENCLIENTMACADDRESS` == 0 && test `cat /etc/hosts | grep -c nordx--image` != 0 && . /home/administrator/scripts/autoconfig # These lines replace all the settings for the student account with a fresh copy of the defaults find /home/student -maxdepth 1 -iname '.?*' -exec rm -rf '{}' \; find /home/student.fresh -maxdepth 1 -iname '.?*' -exec cp -prf '{}' /home/student \; exit 0