Index: install.sh.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/profiles/hostmaster/install.sh.txt,v
retrieving revision 1.4
diff -u -p -r1.4 install.sh.txt
--- install.sh.txt	17 Jul 2009 11:26:27 -0000	1.4
+++ install.sh.txt	31 Jul 2009 13:26:05 -0000
@@ -27,8 +27,15 @@ aegir_environment () {
 
     # Specific to this environment
     apt-get -y install openssh-server;
-    apt-get -y install sendmail;
-
+    # Sendmail installation will remove postfix or exim4 if installed. 
+    # Don't install sendmail unless neither postfix nor exim4 are installed
+    checkmail=`apt-cache policy postfix | grep none`
+    if [[ $checkmail =~ none ]]; then
+      checkmail=`apt-cache policy exim4 | grep none`
+      if [[ $checkmail =~ none ]]; then
+        apt-get -y install sendmail;
+      fi
+    fi
     # Required components
     apt-get -y install wget cvs;
     apt-get -y install mysql-server-5.0;
@@ -45,7 +52,6 @@ aegir_environment () {
     ### Aegir user setup
     ###
     
-    AEGIR_USER="aegir"
     create_user
     
     a2enmod php5;
@@ -94,10 +100,13 @@ find_web_group () {
 }
 
 create_user () {
-  aegir_prompt "Enter the $AEGIR_USER user data and type exit once you see a blank command prompt to return to the script. Press enter to continue."
-  read whatever
+  aegir_prompt "Enter the $AEGIR_USER user data, beginning with the username (i.e aegir), and type exit once you see a blank command prompt to return to the script. Press enter to continue."
+  read AEGIR_USER
+  if [ -z $AEGIR_USER ]; then
+      AEGIR_USER="aegir";
+    fi;
+
   adduser $AEGIR_USER --home /var/$AEGIR_USER;
-  su - $AEGIR_USER;
   
   find_httpd
   find_web_group
@@ -125,7 +134,7 @@ edit_visudo () {
 
 aegir_user () {
   aegir_title "SECTION 1 : Aegir user account"
-  echo "Aegir is designed to run as it's own user that was created specifically for it."
+  echo "Aegir is designed to run as its own user that was created specifically for it."
   if [ $AEGIR_USER != '' ]; then
     echo "Installing Aegir as the $AEGIR_USER user, already created."
     aegir_user_home
@@ -316,9 +325,16 @@ aegir_database () {
   aegir_title "SECTION 5 : Setting up MySQL"
   found=""
   while [ -z "$found" ]; do
+    aegir_prompt "MySQL root username [root]:"
+    read MYSQLUSER
+    if [ -z $MYSQLUSER ]; then
+      MYSQLUSER="root";
+    fi;
     aegir_prompt "MySQL root user password : "
-    read DBPASS
-    found=`mysqladmin -uroot -p$DBPASS ping`
+    stty -echo
+    read DBPASS; echo
+    stty echo
+    found=`mysqladmin -u$MYSQLUSER -p$DBPASS ping`
   done;
   
   echo "Creating mysql database for hostmaster site :"
@@ -328,7 +344,7 @@ aegir_database () {
     HMDB="hostmaster";
   fi;
   
-  mysqladmin -uroot -p$DBPASS create $HMDB
+  mysqladmin -u$MYSQLUSER -p$DBPASS create $HMDB
 
   echo "Creating $HMDB user account :"
   aegir_prompt "Username [hostmaster]:"
@@ -338,10 +354,12 @@ aegir_database () {
   fi;
 
   aegir_prompt "Password:"
-  read HMPASS
+  stty -echo
+  read HMPASS; echo
+  stty echo
 
   echo "GRANT ALL ON $HMDB.* TO '$HMUSER'@'localhost' IDENTIFIED BY '$HMPASS'" | 
-  mysql -uroot  -p$DBPASS $HMDB
+  mysql -u$MYSQLUSER  -p$DBPASS $HMDB
   
   echo "Creating aegir mysql superuser account :"
   aegir_prompt "Username [aegir]:"
@@ -351,10 +369,12 @@ aegir_database () {
   fi;
 
   aegir_prompt "Password:"
-  read AEPASS
+  stty -echo
+  read AEPASS; echo
+  stty echo
 
   echo "GRANT ALL PRIVILEGES ON *.* TO '$AEUSER'@'localhost' IDENTIFIED BY '$AEPASS' WITH GRANT OPTION" | 
-  mysql -uroot  -p$DBPASS $HMDB
+  mysql -u$MYSQLUSER  -p$DBPASS $HMDB
 }
 
 aegir_install () {
