📄 fisprep
字号:
fi RETSTATUS=`cat /tmp/$HOST.fiserror` case $RETSTATUS in 0 ) break;; * ) echo "$PROG: Errors found during fissizer script" | tee -a ${LOGPATH}/${LOGNAME} echo "$PROG: Operation Aborted." | tee -a ${LOGPATH}/${LOGNAME} ERRFLAG=1 Check_For_Errors Mail_Completion_Status if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Stopped: `date` ($REVINFO)" fi exit 1;; esac# Assign some variables from the fissizer run. FSSIZCFG=`cat /tmp/$CLIENT.fisconfig` set $FSSIZCFG MACHTYPE=$2 CPUTYPE=$3 if [ "$COW_SIDECAR" = "TRUE" ] then PHYSMEM=$COW_PM else PHYSMEM=$4 fi export $MACHTYPE}############################################################################### -- Execute the fisconfig script############################################################################### This function will call fisconfig to determine the target system disk for# the ULTRIX/FIS process.Execute_fisconfig(){ if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Executing the Execute_fisconfig() Function" fi# Execute fisconfig and report if any errors were found. cd $HOME fisconfig $INVOKE_FLAG | tee -a ${LOGPATH}/${LOGNAME} RETSTATUS=`cat /tmp/$HOST.fiserror` case $RETSTATUS in 0 ) break;; * ) echo "$PROG: Errors found during fisconfig script" | tee -a ${LOGPATH}/${LOGNAME} echo "$PROG: Operation Aborted." | tee -a ${LOGPATH}/${LOGNAME} ERRFLAG=1 Check_For_Errors Mail_Completion_Status if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Stopped: `date` ($REVINFO)" fi exit 1;; esac}############################################################################### -- Execute the fisld script############################################################################### This function will call fisld to perform the actual transfer of information# to the client from the server.Execute_fisld(){ if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Executing the Execute_fisld() Function" fi# Fill the TARGET_SYSTEM_DISK variable for ease of use by the operator. FISDISKS=`cat /tmp/$HOST.diskinfo` set $FISDISKS if [ "$1" = "1" ] then shift 1 SYSDISK="$2($1)" else shift 1 DISK1="$2($1)" shift 8 SYSDISK="$DISK1/$2($1)" fi# Add to the banner of client info by adding the target system disk# and when the process started. echo "TARGET SYSTEM DISK $SYSDISKMACHINE TYPE $MACHTYPECLIENT CPU TYPE $CPUTYPEPHYSICAL MEMORY $PHYSMEMDATE PROCESS STARTED $STARTDATE " | tee -a ${LOGPATH}/${LOGNAME}# Start fisld which will do the actual transfer of data bits. if [ "$MINIMUM_RUN" != "TRUE" ] then $HOME/fisld $INVOKE_FLAG | tee -a ${LOGPATH}/${LOGNAME} else $HOME/fisld $INVOKE_FLAG -test | tee -a ${LOGPATH}/${LOGNAME} fi# We're back from fisld, so get a date stamp and write it to the log file. RETSTATUS=`cat /tmp/$HOST.fiserror` case $RETSTATUS in 0 ) break;; * ) echo "$PROG: Errors found during fisld script" | tee -a ${LOGPATH}/${LOGNAME} echo "$PROG: Operation Aborted." | tee -a ${LOGPATH}/${LOGNAME} ERRFLAG=1 Check_For_Errors Mail_Completion_Status if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Stopped: `date` ($REVINFO)" fi exit 1;; esac ENDDATE=`date +%d-%h-19%y,%T` echo "\nDATE PROCESS ENDED $ENDDATE" | tee -a ${LOGPATH}/${LOGNAME}}############################################################################### -- Check for errors from either uerf or fisld############################################################################### Grep thru the logfile to ensure that no errors were reported by fisld# during the process. Then, run uerf to confirm that there are no system# errors recorded during the testing period.Check_For_Errors(){ if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Executing the Check_For_Errors() Function" fi# First, we check the logfile for any fisld process errors. [ -s ${LOGPATH}/${ERRFILE} ] && { if grep -v -s lost+found ${LOGPATH}/${ERRFILE} then# An error was found so set the ERRFLAG to notify the technician and write# an informative message to the console." ERRFLAG=1 echo "\n$PROG: Unexpected 'fisld' process errors\c" echo " occured while installing FIS software onto $MACHTYPE\c" echo ", serial number $SN, from $SERVER.\n" echo "Check the following file to determine the type of error\c" echo " that occured:\n" echo " ${LOGPATH}/${LOGNAME}" fi# Now, write the errors from the error file into the logfile for permenant# storage. echo "\n#################### FIS Process Errors Recorded Here #########################" >> ${LOGPATH}/${LOGNAME} cat ${LOGPATH}/${ERRFILE} >> ${LOGPATH}/${LOGNAME} case $? in 0 ) rm -f ${LOGPATH}/${ERRFILE} ;; * ) echo "$PROG: Could not append process error file to FIS log file (WARNING)." ;; esac }# Now, we check the system error log file for any system errors. This check# does not affect the ERRFLAG as any errors should have been caught above.# Also, note we do not check the success of the append. echo "\n#################### System Error Logger Recorded Here ########################" >> ${LOGPATH}/${LOGNAME} uerf -t s:$STARTDATE e:$ENDDATE >> ${LOGPATH}/${LOGNAME}}############################################################################### -- Execute the fiscleanup script############################################################################### This function will call fiscleanup to perform cleanup functions such as# updating the /etc/fstab file and printing the customer letter.Execute_fiscleanup(){ if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Executing the Execute_fiscleanup() Function" fi# Execute fiscleanup and report if any errors were found. cd $HOME if [ "$MINIMUM_RUN" != "TRUE" ] then fiscleanup $INVOKE_FLAG | tee -a ${LOGPATH}/${LOGNAME} else fiscleanup $INVOKE_FLAG -test | tee -a ${LOGPATH}/${LOGNAME} fi RETSTATUS=`cat /tmp/$HOST.fiserror` case $RETSTATUS in 0 ) break;; * ) echo "$PROG: Errors found during fiscleanup script" | tee -a ${LOGPATH}/${LOGNAME} echo "$PROG: Operation Aborted." | tee -a ${LOGPATH}/${LOGNAME} ERRFLAG=1 Check_For_Errors Mail_Completion_Status if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Stopped: `date` ($REVINFO)" fi exit 1;; esac}############################################################################### -- Mail the logfile to the technician############################################################################### Mail the logfile to the technician interface account on the server.Mail_Completion_Status(){ if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Executing the Mail_Completion_Status() Function" fi# If the ERRFLAG is set, make the technician press [Return] to help ensure# the error is noted. Otherwise, simply mail the log to the server fis# account. case $ERRFLAG in 1 ) MESSAGE="${CLIENT} failed to FIS - please read message" if [ "$MINIMUM_RUN" = "FALSE" ] then /usr/ucb/mail -v -s "${MESSAGE}" ${MAIL_TO} < ${LOGPATH}/${LOGNAME} echo "\nPlease Press [Return] to continue: \c" read resp else echo "$PROG: ${MESSAGE}" fi cp ${LOGPATH}/${LOGNAME} $HOME/ARCHIVE/${LOGNAME} ;; * ) MESSAGE="${CLIENT} has completed FIS installation - please check system" if [ "$MINIMUM_RUN" = "FALSE" ] then rm -f $FISINITPATH/$CLIENT.fisinit echo "\nNow sending status mail to: ${MAIL_TO}" /usr/ucb/mail -v -s "${MESSAGE}" ${MAIL_TO} < ${LOGPATH}/${LOGNAME} else echo "$PROG: ${MESSAGE}" fi ;; esac if [ "$MINIMUM_RUN" != "TRUE" ] then rm -f /tmp/$CLIENT.fisdisks rm -f /tmp/$CLIENT.fisconfig rm -f /tmp/$CLIENT.Letter rm -f /tmp/$CLIENT.Fstab rm -f /tmp/$CLIENT.warning_swap fi rm -f /tmp/$CLIENT.diskinfo rm -f /tmp/$CLIENT.partinfo rm -f /tmp/$CLIENT.fsinfo rm -f /tmp/$CLIENT.imginfo rm -f /tmp/$CLIENT.fiserror}############################################################################### -- Main Program Execution Starts Here##############################################################################Initialize_VariablesExecute_fissizerExecute_fisconfigExecute_fisldCheck_For_ErrorsExecute_fiscleanupMail_Completion_Statusif [ "$DEBUG" = "TRUE" ]then echo "$PROG: Stopped: `date` ($REVINFO)"ficd $CWDif [ "$MINIMUM_RUN" = "FALSE" ]then sleep 5 /etc/haltfiexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -