home *** CD-ROM | disk | FTP | other *** search
- # @(#)request 1.2
- # Client kit request script
- #
- # Prompts user for the location to store client disk images.
- #
- # Uses the set_strings file from nws
-
- #
-
- # This script must be executed from the nws or nwsJ request script.
- if [ "$CONFFLAG" = "" ]
- then
- XXSETNAME=""
- [ $PKGINST = nwsclntJ ] && XXSETNAME=J
- echo "\tPlease install the set:\
- \n\tNetWare Server for UnixWare Set (nws$XXSETNAME)\
- \n\tto install $PKGINST"
- exit 3
- fi
-
- if [ "$RANDOM" = "$RANDOM" ]
- then
- exec /usr/bin/winxksh $0 $*
- fi
-
- trap "" 2
-
- exec 2> /tmp/nwsclnt.err
-
- POST_FILE=$1
-
-
- CLIENT_OS_1="MS-DOS/WIN"
- CLIENT_OS_2="OS/2"
- CLIENT_OS_3="MS-DOS/WIN AND OS/2"
-
- # Location of client files in package REQDIR + this directory
- IMAGES_PATH="/NWClient"
- CLIENT_OS=$CLIENT_OS_1
- CLASSES="none doswin"
-
-
-
- #-------------------------------------------------------------------------------
- # DoIt
- #
- # Prompt for location of diskette images
- # Default: /NWClient
- #
- function DoIt
- {
- [ -n "$DEBUG" ] && set -x
-
- integer infoWindow thisWindow thisForm inputXLoc
-
- WINPARMS="-below 0 -border_fg $BLACK -fg $BLACK -bg $CYAN"
-
- #
- # display info window
- #
- display "$C_CLIENT_INFO_WIN" -fg ${WHITE} -bg ${BLUE} -below 4
- infoWindow=${CURWIN}
-
- #------------------ BEGIN FORM ----------------------
-
- let inputXLoc=${#C_IMAGES_PATH_PROMPT}+2
-
- open_form
- thisForm=${FID}
-
- #
- # Location of diskette images
- #
-
- add_field CLIENT_OS -ilen 19 -p "$C_CLIENT_OS_PATH_PROMPT" \
- -px 0 -py 1 \
- -pfg ${BLACK} -pbg ${CYAN} -ix $inputXLoc -iy 1 \
- -choice "ChooseClientOS" \
- -entry "footer '$CLNT_FORM_MSG_OS'" \
- -help "helpwin clientOS" \
- -exit "CheckClientOS"
-
- add_field IMAGES_PATH -ilen 60 -p "$C_IMAGES_PATH_PROMPT" \
- -px 0 -py 2 \
- -pfg ${BLACK} -pbg ${CYAN} -ix $inputXLoc -iy 2 \
- -entry "footer '$FORM_MSG'" \
- -help "helpwin clientDir" \
- -exit "CheckImageLoc"
-
- WINTITLE="$C_CLIENT_MENU_TITLE"
-
- place_window 80 2+2 \
- -title "$WINTITLE" \
- -border_fg $BLACK -bg $CYAN \
- -below 0
-
- thisWindow=${CURWIN}
-
- run_form ${thisForm}
-
- input_handler
-
- wclose ${thisWindow}
- destroy_form ${thisForm}
-
- #------------------ END FORM ----------------------
-
- wclose ${infoWindow} # close info window
-
- footer ""
-
- return 0
- }
-
- function ChooseClientOS
- {
- [ -n "$DEBUG" ] && set -x
-
- set -A osChoices "$CLIENT_OS_1" "$CLIENT_OS_2" "$CLIENT_OS_3"
-
- CHOOSE_TITLE=$C_CLIENT_OS_CHOOSE_TITLE
- CHOOSE_FOOTER=$GENERIC_CHOOSE_FOOTER
-
- choose -f "" "${osChoices[@]}"
-
- return 0
- }
-
- function CheckClientOS
- {
- [ -n "$DEBUG" ] && set -x
-
- typeset -u OS
-
- OS=$CLIENT_OS
-
- if [ "$OS" != "$CLIENT_OS_1" ]
- then
- if [ "$OS" != "$CLIENT_OS_2" ]
- then
- if [ "$OS" != "$CLIENT_OS_3" ]
- then
- display -w "$C_ILL_CLIENT_OS" \
- -fg ${WHITE} -bg ${RED} \
- -current "footer $ENTER_TO_CONT_MSG"
- return 1
- fi
- fi
- fi
-
- if [ "$OS" = "$CLIENT_OS_1" ]
- then
- CLASSES="none doswin"
- elif [ "$OS" = "$CLIENT_OS_2" ]
- then
- CLASSES="none os2"
- else
- CLASSES="none doswin os2"
- fi
-
- return 0
- }
-
- function CheckImageLoc
- {
- [ -n "$DEBUG" ] && set -x
-
- typeset tmp
-
- tmp=`echo "$IMAGES_PATH" | cut -c1`
- if [ "$tmp" != "/" ]
- then
- display -w "$C_INCORRECT_IMAGE_PATH" \
- -fg ${WHITE} -bg ${RED} \
- -current "footer $ENTER_TO_CONT_MSG"
- return 1
- fi
-
- if [[ ! -d $IMAGES_PATH && -a $IMAGES_PATH ]]
- then
- display -w "$C_IMAGE_PATH_IS_FILE" \
- -fg ${WHITE} -bg ${RED} \
- -current "footer $ENTER_TO_CONT_MSG"
- return 1
- fi
-
-
- return 0
- }
-
- #-------------------------------------------------------------------------------
-
- function WritePostFile
- {
- [ -n "$DEBUG" ] && set -x
-
- {
- echo IMAGES_PATH="$IMAGES_PATH"
- echo CLIENT_OS="\"$CLIENT_OS\""
- echo CLASSES="\"$CLASSES\""
- echo SMART_START=$SMART_START
- } > ${POST_FILE}
-
- return 0
- }
-
- function ReadPostFile
- {
- [ -n "$DEBUG" ] && set -x
-
- if [ -f ${POST_FILE} ]
- then
- . ${POST_FILE}
- fi
-
- return 0
- }
-
-
- #===============================================================================
- # Main()
- #
- [ -n "$DEBUG" ] && set -x
-
- . $REQDIR/misc_func # read in support functions
-
- SetLocale
-
- . ${LANGDEP_SCRIPTS}/set_strings # load strings
-
- if (( $CONFFLAG == 1 )) # user has selected to run configuration scripts
- then
- # Initialize winxksh
- . /usr/lib/winxksh/winrc
- . /usr/lib/winxksh/scr_init
- . /etc/dcu.d/menus/choose
- ReadPostFile
- DoIt
- else # user not solicited for input "accept all and install"
- ReadPostFile
- fi
-
- CreateUsersAndGroups
- WritePostFile
-
- exit 0
-