#!/bin/sh #set -x PATH=/bin:/sbin:/usr/bin:/usr/sbin export PATH LD_LIBRARY_PATH umask 022 # Subroutines # ----------- echoc() { echo $1 | tee -a /var/sadm/system/logs/S99-01-proto.log | tee -a /dev/console } err() { echoc echoc "\v\t Error: $*" echoc "\v\t Press any key to reboot in single-user mode ... " read x init s } # -------------------------------------------------------------------------- # Main # -------------------------------------------------------------------------- echoc echoc " S99-01-proto: ------------ start --------------" PATH=/bin:/sbin:/usr/bin:/usr/sbin export PATH umask 022 echoc "S99-01-proto: update variables: ... \t\c" PATH=/opt/csw/bin:/opt/csw/sbin:/usr/local/bin:/usr/local/sbin:${PATH} LD_LIBRARY_PATH=/opt/csw/lib:/usr/local/lib:/lib echoc "OK" echoc " S99-01-proto: mount source data ... \t\c" [ -d /tmp/mnt ] || mkdir /tmp/mnt mount 16.106.64.56:/jumpstart/sol-refresh/proto /tmp/mnt || err "Can't mount source!" echoc "OK" echoc " S99-01-proto: prepare system ... \t\c" rm -rf /var/log/* || err "Can't prepare system" echoc "OK" echoc " S99-01-proto: sync proto tree ... \t\c" ln -s /usr/bin/rsync /usr/local/bin/rsync || err "Can't create symlink for rsync" /usr/local/bin/rsync -avHb --suffix=.orig /tmp/mnt/ / || err "Can't sync proto tree" #/opt/csw/bin/rsync -avHb --suffix=.orig /tmp/mnt/ / || err "Can't sync proto tree" sleep 10 /usr/local/bin/rsync -avHb --suffix=.orig /tmp/mnt/ / || err "Can't sync proto tree" #/opt/csw/bin/rsync -avHb --suffix=.orig /tmp/mnt/ / || err "Can't sync proto tree" echoc "OK" echoc " S99-01-proto: update system ... \t\c" newaliases || err "Can't update new aliases" echoc "OK" cd / umount -f /tmp/mnt || err "Can't unmount /tmp/mnt" echo "`date` : 01 : HP-BCS prototype tree" >> /etc/release mv /etc/rc3.d/S99-01-proto /etc/rc3.d/_S99-01-proto echoc " S99-01-proto: ------------ finish --------------" #echoc " S99-01-proto: system is being restarted........." #touch /reconfigure #init 6 | tee -a /dev/console #sleep 300 #reboot exit 0