#!/bin/sh # #ident "@(#)request 1.37 02/22/99 SMI" # # Copyright 02/22/99 Sun Microsystems, Inc. All Rights Reserved # # Request script: package SUNWsds # # Exit codes for installation scripts e_ok=0 e_fatal=1 # stop installation on this exit e_warning=2 # Installation will go on. e_int=3 # Interrupted. Stop installation e_reboot=10 # User must reboot after installation of all selected packages e_rebootnow=20 # User must reboot right after installation of current package # To be added to one of the single-digit exit code above # Trap interrupt trap `exit $e_int` 15 echo "\nInstalling package <$PKGINST>: $NAME\n" CLASSES="none build" BACKUPNAME=/usr/tmp/dsutlconf BACKUPDIR=$BACKUPNAME.$$ VARDIR=/var/opt/SUNWconn/ldap ETCDIR=/etc/opt/SUNWconn/ldap ASK_CORRECT="Is this correct?" # # Declare all parameters needed by build script # # # SNMP # DEFAULT_SNMP_TRAP_RECIPIENTS="" SNMP_TRAP_RECIPIENTS=$DEFAULT_SNMP_TRAP_RECIPIENTS # main () INSTALL_SNMP_AGENT=1 # # echo $1, $2 contains default # askyesno_default () { while true do echo "$1 (y/n) [$2]: \c" read ans if [ "$ans" = "" ] then ans=$2 fi case $ans in "Y"|"y") return 1;; "N"|"n") return 0;; *) echo "\tInvalid Input: $ans";; esac done } askstring_default () { QSTRING="" while true do echo "$1 [$2]: \c" read ans if [ "$ans" = "" ] then ans=$2 fi if [ "$ans" = "" ] then echo "A non-null answer is required" else QSTRING=$ans ; return 0 fi done } # # Test if a previously saved version exists and is compatible # unset RESTORECONF SAVEDCONF=`/bin/ls -dt $BACKUPNAME* 2>/dev/null | /bin/head -1` if [ "$SAVEDCONF" != "" ] then if [ -d $SAVEDCONF -a -f $SAVEDCONF/Deja.properties ] then SAVEDVERSION=`grep VERSION= $SAVEDCONF/Deja.properties 2>/dev/null | sed "s/.*VERSION=//"` # # List here all the versions you want to support for automatic restore # #case "$SAVEDVERSION" in #4.1) echo "A compatible saved configuration exists in $SAVEDCONF" if [ "$RESTORECONFIG" = "YES" ] then RESTORECONF=$SAVEDCONF else askyesno_default "Do you want to restore it? " y if [ $? -eq 1 ] then RESTORECONF=$SAVEDCONF fi fi #*);; #esac fi fi # # Make parameters available to pkg environment and so # to all the other scripts. # Format: MACRO=macrovalue # cat > $1 <