#!/bin/sh # It is imperative to install the latest patch cluster # prior to placing this system in production FailureNotice() { echo "\n\nInstallation of the patch cluster failed." echo "\nMake sure to download and install the latest patch cluster from" echo "$URL\nbefore placing this system in production.\n" [ -s /tmp/8_Recommended.zip ] && rm /tmp/8_Recommended.zip exit 1 } trap FailureNotice 1 2 3 15 # Check /var/tmp for adequate disk space if [ "`df -lk /var/tmp | tail -1 | awk '{print $4}'`" -lt 425000 ] ; then echo "/var/tmp must have at least 425MB free to extract the patch cluster." exit 1 fi # Check /tmp for adequate disk space if [ "`df -lk /tmp | tail -1 | awk '{print $4}'`" -lt 125000 ] ; then echo "/tmp must have at least 125MB free to download the patch cluster." exit 1 fi # Path to wget WGET=/usr/local/bin/wget # URL to patch cluster URL=ftp://patches.sun.com/patchroot/clusters/8_Recommended.zip URL_NO_DNS=ftp://192.18.108.60/patchroot/clusters/8_Recommended.zip # Retrieve patch cluster echo "Retrieving patch cluster...\n" cd /tmp [ -s 8_Recommended.zip ] && rm 8_Recommended.zip $WGET $URL # Active FTP failed, try other methods [ ! -s 8_Recommended.zip ] && $WGET --passive-ftp $URL [ ! -s 8_Recommended.zip ] && $WGET $URL_NO_DNS [ ! -s 8_Recommended.zip ] && $WGET --passive-ftp $URL_NO_DNS # Install patch cluster if [ -s "8_Recommended.zip" ] ; then echo "Installing patch cluster. This may take several hours." echo "The system will be rebooted after completion." cd /var/tmp [ -d 8_Recommended ] && rm -r 8_Recommended unzip -qq /tmp/8_Recommended.zip cd 8_Recommended ./install_cluster -q # Patch cluster installation may re-enable certain services for SERVICE in S90wbem S73cachefs.daemon S71ldap.client do if [ -s /etc/rc2.d/${SERVICE} ] ; then mv /etc/rc2.d/${SERVICE} /etc/rc2.d/NO${SERVICE} fi done if [ -x /usr/local/fix-modes/fix-modes ] ; then echo "\nRunning fix-modes...\n" /usr/local/fix-modes/fix-modes fi echo "\nRebooting system...\n" shutdown -i6 -g30 -y & else FailureNotice() fi