Browse Source

Bug(s) fixed: 154064
Bug Description: RPM setup should prompt for install mode
Reviewed by: Nathan (Thanks!)
Files: see diff
Branch: HEAD
Fix Description: Added a new shell function ask123 to ask the user for the install mode. Use the -m mode argument to ns-config.
Platforms tested: RHEL3
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none

Rich Megginson 20 years ago
parent
commit
898270bfcb
1 changed files with 36 additions and 2 deletions
  1. 36 2
      ldap/cm/newinst/setup

+ 36 - 2
ldap/cm/newinst/setup

@@ -57,6 +57,28 @@ askYN() {
 	done
 }
 
+ask123() {
+ 	prompt=$2
+ 	default=$1
+ 	finished=
+ 	ans=
+ 	while ! [ $finished ]; do
+		echo -n ""
+		echo ""
+		echo -n $prompt "" | tee -a $logfile
+		read ans
+		echo $ans >> $logfile
+		if ! [ $ans ]; then
+			return $default
+		fi
+		case "$ans" in
+		1|2|3) finished=1 ;;
+		*) echo "Please answer 1, 2, or 3" | tee -a $logfile ;;
+		esac
+	done
+	return $ans
+}
+
 logfile=`doMktmp log`
 myargs=
 silent=
@@ -121,6 +143,18 @@ if ! [ $silent ]; then
 	askYN "Continue?"
 fi
 
+# install mode
+if ! [ $silent ]; then
+	echo ""
+	echo "Please select the install mode:"
+	echo "  1 - Express - minimal questions"
+	echo "  2 - Typical - some customization (default)"
+	echo "  3 - Custom - lots of customization"
+	
+	ask123 "2" "Please select 1, 2, or 3 (default: 2) "
+	installmode=$?
+fi
+
 # if silent mode, do not run the pre-installer programs
 # otherwise, create a temp file for their use
 if ! [ $silent ]; then
@@ -169,12 +203,12 @@ if ! [ $silent ]; then
 
 	# first, run ds
 	cd bin/slapd/admin/bin
-	./ns-config -f $inffile -l $logfile || doExit
+	./ns-config -f $inffile -l $logfile -m $installmode || doExit
 	cd ../../../..
 
 	# next, run admin
 	cd bin/admin
-	./ns-config -f $inffile -l $logfile || doExit
+	./ns-config -f $inffile -l $logfile -m $installmode || doExit
 	cd ../..
 fi