#platform=x86, AMD64, or Intel EM64T key --skip # System authorization information auth --useshadow --enablemd5 # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information #clearpart --linux --initlabel --drives=sda # Use text mode install text # Firewall configuration firewall --enabled --ssh --trust=eth0 # Run the Setup Agent on first boot firstboot --disable # System keyboard keyboard us # System language lang en_US # Installation logging level logging --level=info # Use network installation cdrom #url --url=http://192.168.1.7/rhel6.1_64 # Network information network --bootproto=dhcp --device=eth0 --onboot=on # Reboot after installation #reboot #Root password rootpw --iscrypted $1$b2bDwXkz$ZpKi4Jx7tox779nrUdt8h1 # SELinux configuration selinux --permissive # Do not configure the X Window System skipx # System timezone timezone America/Chicago # Install OS instead of upgrade install # Disk partitioning information part / --fstype="ext4" --onpart=sda1 #part swap --recommended part /usr2 --fstype="ext3" --onpart=sda2 --noformat #%include /tmp/swapsize %pre DEVICE="" find_passport () { passport_device="" dev_names=(sda sdb sdc sdd sde) for thisdev in ${dev_names[@]} do # WD (Western Digital) is the vendor found=0 vendor_file="/sys/block/$thisdev/device/vendor" if [ -f $vendor_file ] then exec < $vendor_file while read line do if [[ $line =~ "WD" ]] then found=1 break fi done fi if [ $found -eq 0 ] then continue fi # ... AND Model is correct. # Note it is important to look at the model. Some shops # could have internal Western digital HDDs. If we were # to only look for "WD" drive, and not look for this particular # model, then, we could inadvertently use the "real" device # as the "backup" device, which would be catastrophic. model_file="/sys/block/$thisdev/device/model" if [ -f $model_file ] then exec < $model_file while read line do if [[ $line =~ "My Passport" ]] then found=1 break fi done fi if [ $found -eq 0 ] then continue fi # found a match passport_device="/dev/$thisdev" break done DEVICE=$passport_device } if [ -d "/sys/block" ] then find_passport fi if [ $DEVICE = "/dev/sda" -o \ $DEVICE = "/dev/sdb" -o \ $DEVICE = "/dev/sdc" -o \ $DEVICE = "/dev/sdd" -o \ $DEVICE = "/dev/sde" ] then # use separate virtual console for output VCON=3 exec < /dev/tty$VCON > /dev/tty$VCON 2>/dev/tty$VCON chvt $VCON echo echo "**********************************************************" echo 'Starting Teleflora Kickstart $Revision: 1.18 $' echo "**********************************************************" echo echo echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!" echo "!!!! ERROR! Passport Drive is plugged in as device $DEVICE." echo "!!!! Since the assumption is that the passport drive contains" echo "!!!! backup data and that data could be destroyed by the" echo "!!!! installation, the installation will not proceed." echo "!!!!" echo "!!!! Please unplug the Western Digital Passport device and" echo "!!!! then re-try this kickstart." echo "!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" echo echo echo "Sleeping for 10 seconds... and then rebooting." echo sleep 10 reboot fi %post cat << xxxEOFxxx > /tmp/ksrti.sh #!/bin/bash LOG="/tmp/ksrti.sh.log" /tmp/ksrti_upgrade.sh 2>&1 | tee -a \$LOG xxxEOFxxx cat << xxxEOFxxx > /tmp/ksrti_upgrade.sh #!/bin/bash # Script to run, just after a kickstart, which will start things rolling. ping -c 1 google.com if [ \$? -eq 0 ]; then echo "Internet connection working.....continuing" else echo "Internet connection down.....exiting" exit 1 fi echo "\`date\` -- Beginning RTI Upgrade " >/tmp/verify.txt wget -O - http://rtihardware.homelinux.com/ostools/install-ostools-1.13.pl | perl - --update /usr2/ostools/bin/rtibackup.pl --restore=all --force --device=/usr2/upgrade/upgrade_backup.img /tmp/java_install.sh /usr2/ostools/bin/updateos.pl --rhnreg /usr2/ostools/bin/updateos.pl --ospatches /usr2/ostools/bin/updateos.pl --init-console-res echo "\`date\` -- End RTI Upgrade " >>/tmp/verify.txt /tmp/verify.sh echo "Please reboot the system......" xxxEOFxxx cat << xxxEOFxxx > /tmp/java_install.sh #!/usr/bin/expect spawn /usr2/upgrade/jre-6u16-linux-x64-rpm.bin expect -- "--More--" send "q"; expect "yes or no" send "yes\n"; interact xxxEOFxxx if [[ ! -e /etc/profile.d/term.sh ]]; then cat << xxxEOFxxx > /etc/profile.d/term.sh unicode_stop xxxEOFxxx fi cat << xxxEOFxxx >> /tmp/verify.sh echo "--------------------">>/tmp/verify.txt echo "ifconfig results....">>/tmp/verify.txt ifconfig >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "etc/hosts ....">>/tmp/verify.txt cat /etc/hosts >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "etc/resolve.conf .....">>/tmp/verify.txt cat /etc/resolv.conf >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "netstat results....">>/tmp/verify.txt netstat -rn >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "etc/samba/smb.conf .....">>/tmp/verify.txt cat /etc/samba/smb.conf >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "usr2/basis/basis.lic .....">>/tmp/verify.txt cat /usr2/basis/basis.lic >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt echo "/etc/hosts.allow">>/tmp/verify.txt cat /etc/hosts.allow >>/tmp/verify.txt echo "--------------------">>/tmp/verify.txt mail -s \`hostname\` mgreen@teleflora.com,kpugh@teleflora.com,sjackson@teleflora.com