home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 March B
/
SCO_CASTOR4RRT.iso
/
encrypt
/
install
/
request
< prev
next >
Wrap
Text File
|
1998-08-19
|
3KB
|
105 lines
#!/bin/sh
#
# @(#) request.shinc 12.1 97/11/03
#
# 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"
# eclicense return codes and menus check file
ECLICENSE_MSGS="eclicense.msgs"
ECLICENSE_COVERED=0; ECLICENSE_ADDED_EVAL=1
ECLICENSE_NOT_LICENSED=2; ECLICENSE_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/$ECLICENSE_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
# call a routine to check for, and optionally add, licensing for
# the product
if [ -f $INSTALL_DIR/eclicense.sh ]; then
# layered installation - questions are OK
sh $INSTALL_DIR/eclicense.sh $INSTALL_DIR/l_info $MENU_DIR
# if no valid license was added then abort the installation,
# otherwise continue
case $? in
${ECLICENSE_COVERED})
exit $SUCCESS
;;
${ECLICENSE_ADDED_EVAL})
exit $SUCCESS
;;
${ECLICENSE_NOT_LICENSED})
exit $FAIL
;;
${ECLICENSE_FAIL})
echo "$ME: eclicense.sh script failed" >&2
exit $FAIL
;;
esac
else
echo "$ME: unable to find $INSTALL_DIR/eclicense.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