#!/bin/sh # # One-Shot installation customization via the rc.local file # This script will be executed *after* all the other init scripts. # This version gets run ONCE and then replaces itself with something else, # if it exists # # @(#) Last changed: -EAM 23Jul2003 sleep 1 clear echo " " echo " Kick-Me: ONE TIME ONLY rc.local INITIALIZATION..." echo " " #################### ## Hostname and Network: X=`egrep "^HOSTNAME=" /etc/sysconfig/network` if [ "$X" = "" -o "`hostname`" = "kick-me" ]; then echo " " echo " " echo -n " Enter new hostname: " read HOSTNAME echo $HOSTNAME echo "HOSTNAME=$HOSTNAME" >> /etc/sysconfig/network hostname $HOSTNAME echo " " # check for fixed IP address for linux-install.vassar.edu # and reconfig if not found X=`egrep "^IPADDR /etc/sysconf/network-scripts/ifcfg-eth0` if [ "$X" = "" -o "$X" = "IPADDR=143.229.45.104" ]; then netconfig else echo " You will have to reconfigure the IP address yourself" echo " To do so, give the command \`netconfig\` " fi # restart services to use new setting killall dhcpcd service network restart service syslog restart service portmap condrestart service nfslock condrestart service ypserv condrestart service ypbind condrestart fi ## # record disk size, etc grep MHz /proc/cpuinfo > /tmp/cpu logger -s -p user.notice -f /tmp/cpu grep MemTotal /proc/meminfo > /tmp/mem logger -s -p user.notice -f /tmp/mem fdisk -l /dev/hda | grep cylind > /tmp/cyls logger -s -p user.notice -f /tmp/cyls cat /tmp/cpu /tmp/mem /tmp/cyls | mail -s `hostname` root #################### ## Make an emergency boot disk (just in case...) NOT FOR LINUX 2.6 ? clear echo " " echo " MAKING AN EMERGENCY BOOT DISK." echo " " mkbootdisk `uname -r` echo " " echo " PLEASE REMOVE THE DISK BEFORE THE NEXT REBOOT." echo " " #################### ## Update the tripwire (if we can) TWDIR=/var/spool/lpd/czech if [ -d $TWDIR ]; then cd $TWDIR if [ -d databases ]; then cd databases mv -f tw.db_`hostname` tw.db_`hostname`.old cd .. fi echo " * Initializing Tripwire 1.2L... " ./tripwire -q -c ./tw.config -initialize fi if [ -x /usr/local/adm/Nigel ]; then cd /usr/local/adm ./Nigel -reset fi #################### ## The real rc.local (or none at all) rm /etc/rc.d/rc.local if [ -f /etc/rc.d/rc.local.new ]; then mv -f /etc/rc.d/rc.local.new /etc/rc.d/rc.local # cd /etc/rc.d # . rc.local fi #################### clear echo " " echo " ONE-TIME INITIALIZATION FINISHED. Thank You for Your PATIENCE. " echo " " echo " Please remove the emergency boot disk and press ENTER to reboot..." echo " " read X shutdown -h now exit 0 ##EOF