📄 fisld
字号:
echo "1" >/tmp/$HOST.fiserror exit 1 ;; esac done}############################################################################### -- Create new file systems for client############################################################################### Reading the fisconfig FSINFO file, we issue a call to make all file systems# for the client system wityh newfs.FS_Routine(){( if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Executing the FS_Routine() Function" fi echo "\n*** ULTRIX/FIS FACTORY CREATION OF FILE SYSTEMS ***\n"# Read the FSINFO file and loop thrugh all file systems listsed. FS_INFO=`cat /tmp/$HOST.fsinfo` set $FS_INFO while [ $# -gt 0 ] do# Allow the "swap" file system to be listed for completeness but make sure# we don't try to actually create a "swap" filesystem. case $5 in swap ) shift 5 continue ;; esac# Place call to Newfs_Routine to do the work. echo "Creating '$5' file system on $2 /dev/r${1}${3}..." (Newfs_Routine $1 $2 $3 -s $4) shift 5 done)}############################################################################### -- Check new file systems for client############################################################################### Reading the fisconfig FSINFO file, we issue a call to check all file systems# for the client system with fsck.Fsck_Routine(){ if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Executing the Fsck_Routine() Function" fi echo "\n*** ULTRIX/FIS FACTORY CHECKOUT OF FILE SYSTEMS ***\n"# Read the FSINFO file and loop thrugh all file systems listsed. FS_INFO=`cat /tmp/$HOST.fsinfo` set $FS_INFO while [ $# -gt 0 ] do# Allow the "swap" file system to be listed for completeness but make sure# we don't try to actually check a "swap" filesystem. case $5 in swap ) shift 5 continue ;; esac# Determine the filesystem we are dealing with and issue the fsck command. DEV=$1 TYPE=$2 PART=$3 echo "Checking '$5' file system on $TYPE /dev/r$DEV$PART..." if [ "$MINIMUM_RUN" != "TRUE" ] then fsck /dev/r$DEV$PART fi# On a failure, abort the process. case $? in 0 ) shift 5 ;; * ) echo "$PROG: File system check error on $TYPE ${DEV}, partition '${PART}'." echo "$PROG: Operation Aborted." if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Stopped: `date` ($REVINFO)" fi echo "1" >/tmp/$HOST.fiserror exit 1 ;; esac done}############################################################################### -- Generic newfs routine############################################################################### This is a generic routine to call newfs with varius parameters. It is# used by bth the FS_Routine and the Get_Disk_Routine.Newfs_Routine(){ if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Executing the Newfs_Routine() Function" fi# Define paramters and ntify debug f call. DEV=$1 TYPE=$2 PART=$3 if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Newfs for $DEV ($TYPE), Partition $3\c" if [ "$4" = "-s" ] then echo ", Size $5" else echo " " fi fi# Case fr either the -s size or straight call to newfs. case $4 in -s ) SIZE=$5 if [ "$MINIMUM_RUN" != "TRUE" ] then newfs -s $SIZE /dev/r$DEV$PART $TYPE fi ;; * ) if [ "$MINIMUM_RUN" != "TRUE" ] then newfs /dev/r$DEV$PART $TYPE fi ;; esac# Case on the return value and abort if there was an error. case $? in 0 ) ;; * ) echo "$PROG: Error performing newfs on $TYPE /dev/r$DEV$PART." echo "$PROG: Operation Aborted." if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Stopped: `date` ($REVINFO)" fi echo "1" >/tmp/$HOST.fiserror exit 1 ;; esac}############################################################################### -- Get image information############################################################################### Cycle thru the images file and call image ccpy routine for each image listed# in said file.Get_Image_Routine(){ if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Executing the function() Function" fi echo "\n*** ULTRIX/FIS FACTORY IMAGE RESTORATION ***\n"# Read the IMGINFO file. IMAGES=`cat /tmp/$HOST.imginfo` set $IMAGES while [ $# -gt 0 ] do (Image_Copy_Routine $1 $2 $3 $4 $5) shift 5 done}############################################################################### -- Copy images from server to client############################################################################### Cpoy the actual image to the client from the server. This is performed# by a restoration of a compressed dump file.Image_Copy_Routine(){ if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Executing the Image_Copy_Routine() Function" fi# Get info from cmd line and put in variables. DEV=$1 TYPE=$2 PART=$3 DUMP=$4 MNTPNT=$5# Mount the target disk onto a mount point given. echo "Mounting /dev/$DEV$PART on $MNTPNT ... \c" if [ "$MINIMUM_RUN" != "TRUE" ] then mount /dev/$DEV$PART $MNTPNT fi case $? in 0 ) echo done ;; * ) echo "\n$PROG: Error mounting $DEV, Partition $PART" echo "$PROG: Operation Aborted." if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Stopped: `date` ($REVINFO)" fi echo "1" >/tmp/$HOST.fiserror exit 1 ;; esac [ -s $IMAGEPATH/$MACHTYPE/$DUMP ] || { echo "$PROG: $IMAGEPATH/$MACHTYPE/$DUMP Not Found" echo "$PROG: Operation Aborted." if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Stopped: `date` ($REVINFO)" fi echo "1" >/tmp/$HOST.fiserror exit 1 } echo "\nCopying $IMAGEPATH/$MACHTYPE/$DUMP from $SERVER..." Ticker if [ "$MINIMUM_RUN" != "TRUE" ] then cd $MNTPNT rsh $SERVER -l fis -n "dd if=$IMAGEPATH/$MACHTYPE/$DUMP bs=24k" | compress -d | restore rf - 2>>$LOGPATH/$ERRFILE fi case $? in 0 ) Unticker echo "\nImage $IMAGEPATH/$MACHTYPE/$DUMP copied successfully!" echo "Unmounting /dev/$DEV$PART ... \c" cd / if [ "$MINIMUM_RUN" != "TRUE" ] then umount $MNTPNT fi case $? in 0 ) echo done ;; * ) echo "\n$PROG: Error unmounting $DEV, Partition $PART" echo "$PROG: Operation Aborted." if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Stopped: `date` ($REVINFO)" fi echo "1" >/tmp/$HOST.fiserror exit 1 ;; esac echo "\nChecking /dev/r$DEV$PART ... " if [ "$MINIMUM_RUN" != "TRUE" ] then fsck /dev/r$DEV$PART fi case $? in 0 ) ;; * ) echo "$PROG: Error discovered during fsck of $DEV, Partition $PART" echo "$PROG: Operation Aborted." if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Stopped: `date` ($REVINFO)" fi echo "1" >/tmp/$HOST.fiserror exit 1 ;; esac ;; * ) Unticker echo "\n$PROG: Error copying FIS software from $SERVER to $CLIENT." echo "$PROG: Software was $IMAGEPATH/$MACHTYPE/$DUMP to $DEV, Partition $PART" echo "$PROG: Operation Aborted." if [ "$DEBUG" = "TRUE" ] then echo "$PROG: Stopped: `date` ($REVINFO)" fi echo "1" >/tmp/$HOST.fiserror exit 1 ;; esac}############################################################################### -- Main Program Execution Starts Here##############################################################################Get_Disk_RoutineCHPT_RoutineFS_RoutineFsck_RoutineGet_Image_Routineif [ "$DEBUG" = "TRUE" ]then echo "$PROG: Stopped: `date` ($REVINFO)"ficd $CWDecho "0" >/tmp/$HOST.fiserrorexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -