home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 March B
/
SCO_CASTOR4RRT.iso
/
nsnavAu
/
install
/
request
< prev
next >
Wrap
Text File
|
1998-08-19
|
3KB
|
100 lines
#!/bin/sh
#
# @(#) request.shinc 12.2 97/10/28
#
# Copyright (c) 1997 The Santa Cruz Operation, Inc.. All Rights Reserved.
# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE SANTA CRUZ OPERATION INC.
# The copyright notice above does not evidence any actual or intended
# publication of such source code.
#
ME="`basename $0`"
ISL_FILE="/etc/inst/scripts/postreboot.sh"
SUCCESS=0; FAIL=1; INTR=3
trap "exit $INTR" 2 3 15
[ -f $ISL_FILE ] && exec 1>>/var/adm/log/$PKGINST.out
[ -f $ISL_FILE ] && exec 2>>/var/adm/log/$PKGINST.err
# location of the packaging information files during this phase of installation
INSTALL_DIR="$REQDIR/$PKGINST"
# dolicense return codes and menus check file
DOLICENSE_MSGS="dolicense.msgs"
DOLICENSE_COVERED=0; DOLICENSE_ADDED_EVAL=1
DOLICENSE_NOT_LICENSED=2; DOLICENSE_FAIL=3
# check usage
if [ $# -ne 1 ]; then
echo "Usage: $ME response_file" >&2
exit $FAIL
fi
response_file="$1"
#############################################################################
#
# main
#
#############################################################################
# if not in initial system load then check licensing, and add if required
if [ ! -f $ISL_FILE ]; then
# determine the right location for menus - try /etc/inst/locale
# first, and if no menus there then use ones in the installation
# set - try for local ones first, then fall back on C
LOCALE="${LC_ALL:-${LC_MESSAGES:-${LANG:-C}}}"
MENU_DIR="/etc/inst/locale/$LOCALE/menus/$PKGINST"
if [ ! -f $MENU_DIR/$DOLICENSE_MSGS ]; then
if [ ! -d $INSTALL_DIR/$LOCALE ]; then
LOCALE="C"
fi
MENU_DIR=$INSTALL_DIR/$LOCALE
fi
# check the UnixWare release, and abort if it's one of the
# incompatible ones
if [ -f $INSTALL_DIR/releasecheck.sh ]; then
# layered installation - interaction is OK
sh $INSTALL_DIR/releasecheck.sh $MENU_DIR
if [ $? -ne 0 ]; then
exit $FAIL
fi
fi
# check for an admin server, and warn if it isn't there
if [ -f $INSTALL_DIR/noadminwarn.sh ]; then
# layered installation - interaction is OK
sh $INSTALL_DIR/noadminwarn.sh $MENU_DIR
fi
# call a routine to check for, and optionally add, licensing for
# the product
if [ -f $INSTALL_DIR/dolicense.sh ]; then
# layered installation - questions are OK
sh $INSTALL_DIR/dolicense.sh $INSTALL_DIR/l_info $MENU_DIR
# ignore most dolicense return codes since dolicense's
# menu stuff will have told the installer what was done
if [ $? -eq $DOLICENSE_FAIL ]; then
echo "$ME: dolicense.sh script failed" >&2
exit $FAIL
fi
else
echo "$ME: unable to find $INSTALL_DIR/dolicense.sh" >&2
exit $FAIL
fi
# make a note into the environment that the licensing has been checked
# for this installation
echo "REQUEST_CHECKED_LICENSING=\"TRUE\"" >$response_file
else
# in initial system load so defer license stuff to postinstall
echo "REQUEST_CHECKED_LICENSING=\"FALSE\"" >$response_file
fi
# done
exit $SUCCESS