# Purpose: SUNWsnad package request script # Author: Dan Gordon # Creation date: 09/11/98 # # Details: # # Prompts the installer for necessary information. # # This script is meant to be run as part of the SUNWsnad package # installation. # PATH=/bin:/usr/bin:/sbin:/usr/sbin echo echo "Collecting data for installation . . ." # # Get FQDNAUTHNAME # # # Try to determine fqdnauthname from dns first # Get all active IP's and take first one hostiplist=`ifconfig -au | grep -v "127\.0\.0\.1" | awk '/inet/ {print $2}'` hostip=`echo $hostiplist | awk '{print $1}'` fqdnhname=`nslookup $hostip 2> /dev/null | awk '/Name:/ {print $2}'` goodhost1=0 while [ $goodhost1 -eq 0 ] do echo echo "Please enter the fully qualified domain name of the host this" echo "is being installed on. For example: authhost.corp.sun.com..." echo "domain name [$fqdnhname]: \c" read fqdnname fqdnauthname=${fqdnname:-$fqdnhname} hostverified="`echo \"$fqdnauthname\" | \ egrep \"^[a-zA-Z0-9][-a-zA-Z0-9]*\.([a-zA-Z0-9][-a-zA-Z0-9]*\.)*[a-zA-Z0-9][a-zA-Z0-9]*$\"`" if [ -n "$hostverified" ] then goodhost1=1 else echo "Problem with format of host." echo fi done # # get AUTH_PORT # AUTH_PORT=8080 while [ 1 ] do echo "Port for $fqdnauthname [$AUTH_PORT]: \c" read RESPONSE if [ $RESPONSE ]; then AUTH_PORT=$RESPONSE; fi if [ "$AUTH_PORT" != "" ]; then break; fi echo done # # Get DEFAULTURL # goodurl=0 url="http://$fqdnauthname:$AUTH_PORT/servlet/SNDesktop?template=user_login\&onload=clearCookie()" while [ $goodurl -eq 0 ] do echo echo "Please enter the default URL to send authenticated users..." echo "[$url]: \c" read RESPONSE if [ $RESPONSE ]; then url=$RESPONSE fi urlverified="`echo \"$url\" | egrep \"^http://.*\"`" if [ -n "$urlverified" ] then goodurl=1 else echo "Problem with format of URL." echo fi done # # Get the fqdn of the gateway host (rproxy/eproxy) # goodhost1=0 while [ $goodhost1 -eq 0 ] do fqdngatewayname=$fqdnname echo echo "Please enter the fully qualified domain name of the " echo "gateway host [$fqdnname]: \c" read fqdnname if [ $fqdnname ]; then fqdngatewayname=$fqdnname fi hostverified="`echo \"$fqdngatewayname\" | \ egrep \"^[a-zA-Z0-9][-a-zA-Z0-9]*\.([a-zA-Z0-9][-a-zA-Z0-9]*\.)*[a-zA-Z0-9][a-zA-Z0-9]*$\"`" if [ -n "$hostverified" ] then goodhost1=1 else echo "Problem with format of host." echo fi done GATE_PORT=443 goodport1=0 while [ $goodport1 -eq 0 ] do echo "What port will the gateway run on? [$GATE_PORT] \c" read ANS if [ "$ANS" != "" ] then port1verified="`$ECHO \"$ANS\" | egrep \"[0-9]+\"`" if [ -n "$port1verified" ] then GATE_PORT=$ANS echo "Using $GATE_PORT as eproxy port." goodport1=1 else echo "Problem with format of port." echo fi else goodport1=1 fi done # # get the Application defaults # while [ 1 ] do APP_HOST=$fqdnauthname APP_PORT=$AUTH_PORT echo "Application Server Host: [$APP_HOST]: \c" read RESPONSE if [ $RESPONSE ]; then APP_HOST=$RESPONSE; fi echo "Application Server Port: [$APP_PORT]: \c" read RESPONSE if [ $RESPONSE ]; then APP_PORT=$RESPONSE; fi if [ "$APP_HOST" != "" ] && [ "$APP_PORT" != "" ]; then break; fi done # # get the Application defaults # while [ 1 ] do PREF_HOST=$fqdnauthname PREF_PORT=$AUTH_PORT echo "Prefence Server Host: [$PREF_HOST]: \c" read RESPONSE if [ $RESPONSE ]; then PREF_HOST=$RESPONSE; fi echo "Preference Server Port: [$PREF_PORT]: \c" read RESPONSE if [ $RESPONSE ]; then PREF_PORT=$RESPONSE; fi if [ "$PREF_HOST" != "" ] && [ "$PREF_HOST" != "" ]; then break; fi done # # get the Application defaults # LOG_HOST=$fqdnauthname LOG_PORT=$AUTH_PORT while [ 1 ] do echo "Log Server Host: [$LOG_HOST]: \c" read RESPONSE if [ $RESPONSE ]; then LOG_HOST=$RESPONSE; fi echo "Log Server Port: [$LOG_PORT]: \c" read RESPONSE if [ $RESPONSE ]; then LOG_PORT=$RESPONSE; fi if [ "$LOG_PORT" != "" ] && [ "$LOG_HOST" != "" ]; then break; fi done # # Make all vars available to rest of install program # cat > $1 <