#!/bin/sh #pragma ident "@(#)request 1.5 98/09/30 SMI" # # Copyright (c) 1998, by Sun Microsystems, Inc. # All rights reserved. # trap 'exit 3' 15 getans() { # need to get the format string because it must be # quoted fmt=$1 shift printf "$fmt" $* while true ; do read ans if [ "$ans" != "" ] then break else printf "$fmt" $* fi done } getnum_ans() { def=$1 # need to get the format string because it must be # quoted fmt=$2 shift shift printf "$fmt" $* while true ; do read ans if [ "$ans" != "" ] then if expr $ans + 0 ; then if [ $ans -gt 0 ] then break else echo `gettext 'Respond with a number > 0.' ` fi else echo `gettext 'Respond with a number.' ` fi else echo `gettext 'No response. Will use default.' ` ans=$def break fi printf "$fmt" $* done } getYN() { # need to get the format string because it must be # quoted fmt=$1 yval=$2 nval=$3 q2=$4 shift 4 printf "$fmt" $* while true ; do read ans case $ans in $yval ) YN=1 break ;; $nval ) YN=0 break ;; * ) echo $q2 '\c' esac done } # # request_vers in this request script must track request_vers # in the preinstall script. # request_vers=2 cf=$PKG_INSTALL_ROOT/etc/krb5/kdc.conf get_realm=0 get_times=0 get_kdcs=0 KDC_CONF_REPLACE=1 if [ -f $cf ] then echo echo getYN "`gettext 'Note: %s already exists.\nDo you wish to generate a new %s interactively? (y)es/(n)o: `" y n \ "`gettext 'Answer y for yes or n for no:'`" $cf $cf if [ $YN -eq 0 ] then KDC_CONF_REPLACE=0 else get_realm=1 get_times=1 fi else get_realm=1 get_times=1 fi cf=$PKG_INSTALL_ROOT/etc/krb5/kpropd.acl KPROPD_ACL_REPLACE=1 if [ -f $cf ] then echo echo getYN "`gettext 'Note: %s already exists.\nDo you wish to generate a new %s interactively? (y)es/(n)o: `" y n \ "`gettext 'Answer y for yes or n for no:'`" $cf $cf if [ $YN -eq 0 ] then KPROPD_ACL_REPLACE=0 if [ $KDC_CONF_REPLACE -eq 0 ] then cat > $1< $1<