📄 fisstart
字号:
#!/bin/sh5## @(#)fisstart 4.3 (ULTRIX) 4/25/91########################################################################### Copyright (c) 1988, 1989 by# Digital Equipment Corporation, Maynard, MA# All rights reserved.## This software is furnished under a license and may be used and# copied only in accordance with the terms of such license and# with the inclusion of the above copyright notice. This# software or any other copies thereof may not be provided or# otherwise made available to any other person. No title to and# ownership of the software is hereby transferred. ## The information in this software is subject to change without# notice and should not be construed as a commitment by Digital# Equipment Corporation. ## Digital assumes no responsibility for the use or reliability# of its software on equipment which is not supplied by Digital.## 000 Jonathan Wallace 01-Jun-1990# Created original code## 001 James C. Overman 05-Aug-1990# Moved references to /tmp to /usr/tmp and references# of /etc/scampdir to /usr/etc/scampdir## 002 Jonathan Wallace 15-Oct-1990# Changed location of fisinit from /etc to /etc/fis.# Added DEP_ORD call which performs a setld C install.# Changed some text.# # 003 Added query for video display type. Changed year in# date example text.## 004 Rearranged code that moves the customized kernel due# to a change that was put into MAKEDEV.##########################################################################[ -f /etc/fis/.fisinit ] && exit 0term=VT100PATH=/bin:/usr/ucb:/usr/bin:/etc:/etc/fis:/usr/adm:/usr/etc:/devexport TERM PATHset -hLL=""ADVFLAG=1ADMDIR="/usr/adm"FISDIR="/etc/fis"MACHTYPE=`/bin/machine`case "$MACHTYPE" invax ) KERNELPATH="/sys/VAX" CONFIGPATH="/sys/conf/vax" ;;mips) KERNELPATH="/sys/MIPS" CONFIGPATH="/sys/conf/mips" ;;esactrap '' 1 3 18trap 'echo "*** Interrupt signal received from console ***Factory installed software requires that this machine execute a seriesof procedures to properly set up the system before it is ready for use.Booting this system for the first time, without going through the FISstartup procedure, is not allowed. If you want to stop the FIS startupprocedure for some reason, answer 'yes' to the question below and themachine will be halted. If you want to continue with the FIS startupprocedure, answer 'no' to the question below."while :do echo "Do you want to stop the FIS startup procedure? (yes/no) [no]: \c" read resp resp=`echo $resp` case $resp in %% ) # FOR TESTING - BYPASS FISINIT SCRIPT echo " You will be placed into manufacturing test mode when the system reboots. YOU will be responsible for the correct shutdown of the system when you are finished.Do you want to enter manufacturing test mode? (yes/no) [no]: \c" read resp case $resp in yes ) rm -f /usr/adm/fisinit.log touch /etc/fis/mantest /etc/reboot ;; * ) echo "*** Halting Machine ***" /etc/halt ;; esac ;; yes ) echo echo "*** Halting Machine ***" /etc/halt ;; "" | no ) echo echo exit 5 ;; * ) echo "You must answer 'yes' or 'no' to the following question:" ;; esacdone ' 2################ Subroutines # ###############: Ticker - Put time stamps on screenTicker(){ ( while : do echo " working ..... \c" date sleep 120 done )& TICKPID=$!}: Unticker - Stop time stamps to screenUnticker(){ [ -n "$TICKPID" ] && { ( kill -15 $TICKPID wait $TICKPID TICKPID= ) }}: Get_Configname - Get the config name out of sysnameGet_Configname(){( IFS=. set $1 IFS= echo $1 | dd conv=ucase 2>/dev/null)}: Get_Sysname - Get the systemnameGet_Sysname(){ while : true do echo "${LL}*** SYSTEM NAME SPECIFICATION *** " echo "Select the name of your system using alphanumeric characters. The first character must be a letter. For example, tinker.${LL} Enter your system name: \c" read SYSNAME check=`expr $SYSNAME : '\([a-zA-Z][a-zA-Z0-9.]*\)' 2> /dev/null` case $SYSNAME in "" ) continue ;; $check ) ;; * ) echo "You specified $SYSNAME as your system name, which is not valid. Read the following prompt and this time type a valid system name:" continue ;; esac CONFIGNAME=`Get_Configname $SYSNAME` echo "You selected ${SYSNAME} as the name of your system. Is thiscorrect? (y/n) [y]: \c" read resp case $resp in [Yy]* | "") if egrep -s "^/bin/hostname" /etc/rc.local then # Found, replace it with a new one sed "/^\/bin\/hostname.*/s/hostname.*/hostname ${SYSNAME}/"\ /etc/rc.local > /etc/rc.tmp else # Not found, add it at the top echo "/bin/hostname ${SYSNAME}" | cat - /etc/rc.local > /etc/rc.tmp fi mv /etc/rc.tmp /etc/rc.local chmod 644 /etc/rc.local /bin/hostname ${SYSNAME} break ;; *) ;; esac done echo "$SYSNAME $CONFIGNAME" > $FISDIR/sysinfo}: Get_Root_Password - Get the systems Root passwordGet_Root_Password(){ echo "*** SPECIFY THE SUPERUSER PASSWORD *** The installation booklet for your processor instructsyou on how to enter the superuser password." until /bin/passwd root do echo "Trying again to set Super User password...${LL} " done}############################ Start Processing here###########################OPTION=$1case $OPTION in-S ) Get_Sysname exit 0 ;;-P ) Get_Root_Password exit 0 ;;* ) [ -s $FISDIR/sysinfo ] || { echo "ERROR: $FISDIR/sysinfo file does not exist. Cannot complete FIS process." exit 5 } set -- `cat $FISDIR/sysinfo` SYSNAME=$1; CONFIGNAME=$2 rm $FISDIR/sysinfo ;;esac################################################################### Reset trap to loop in the following while-do loops##################################################################trap 'continue' 1 3 18################################################################### Set the Date and TIME##################################################################while : truedo echo "${LL}${LL}*** DATE AND TIME SPECIFICATION *** " echo "The system date and time should be specified using the followingformat: yymmddhhmmUse two digits for year (yy), month (mm), day (dd), hour (hh), andminute (mm). Enter the time in 24-hour format. For example, 11:30p.m. on May 3, 1991 would be entered as: 9105032330Enter the date and time [no default]: \c" read tnc case $tnc in T) tnc= #testing only ;; "") echo "You MUST specify a date and time. ${LL}" ;; [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) date $tnc > /dev/null case $? in 0 ) ;; * ) echo "${LL}Sorry, '${tnc}', is not a valid date entry." ;; esac ;; * ) echo "${LL}Sorry, '${tnc}', is not a valid date entry." ;; esac DATE=`date +%d-%h-%y` TIME=`date +%H:%M` echo "The current system date and time is set to $DATE, $TIME.Is this correct? (y/n) [y]: \c" read resp case $resp in "" | [Yy]* ) break ;; * ) ;; esacdone ################################################################### Set the Timezone ##################################################################while : truedo echo "${LL}*** TIME ZONE SELECTION *** Select the time zone for your area, using the options listed in thetable below. You can also enter the number of hours (-12 to 12) intime east of Greenwich. Selection Time Zone --------------------------------- e Eastern c Central m Mountain p Pacific g Greenwich---------------------------------Enter your choice [no default]: \c" read zone case ${zone} in e|E) zone=Eastern hourswest=5 ZIC="/etc/zoneinfo/US/Eastern" ;; c|C) zone=Central hourswest=6 ZIC="/etc/zoneinfo/US/Central" ;; m|M) zone=Mountain hourswest=7 ZIC="/etc/zoneinfo/US/Mountain" ;; p|P) zone=Pacific hourswest=8
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -