Commit 59c94f04 authored by anarcat's avatar anarcat Committed by anarcat

move confirmation to hostmaster-install and explain what it does

parent 1b8b2d9a
......@@ -4,6 +4,47 @@
* @file install the hostmaster system
*/
function drush_provision_hostmaster_install_validate($site = NULL) {
$version = drush_get_option('version', 'HEAD');
drush_print("Aegir $version automated install script");
drush_print("=======================================");
drush_print('
This script will operate the following changes in your system:
1. Create server-level configuration directories
2. Download drush_make
3. Create the Hostmaster frontend platform
4. Install the frontend site
5. Setup the dispatcher (a user cron job)
We are making the following assumptions:
* you have read INSTALL.txt and prepared the platform accordingly
* you are executing this script as your "aegir" user
');
$go = FALSE;
while (!$go) {
$yesno = trim(strtolower(drush_prompt(dt('Do you really want to proceed with the install'), 'Y/n', TRUE)));
switch ($yesno) {
case 'no':
case 'n':
return drush_set_error(dt('Installation aborted by user'));
break;
case 'yes':
case 'y':
case 'y/n':
$go = TRUE;
break;
default:
drush_print(dt('Please answer "yes" or "no"'));
break;
}
}
return TRUE;
}
function drush_provision_hostmaster_install($site = NULL) {
if (!$site) {
$site = drush_prompt(dt("Aegir domain name"), "aegir.example.com");
......
......@@ -22,10 +22,9 @@
########################################################################
# This script takes the following steps:
#
# 1. prompt for confirmation
# 2. downloads drush in $AEGIR_HOME
# 3. downloads provision in $AEGIR_HOME/.drush
# 4. delegate the rest of the install to hostmaster-install
# 1. downloads drush in $AEGIR_HOME
# 2. downloads provision in $AEGIR_HOME/.drush
# 3. delegate the rest of the install to hostmaster-install
########################################################################
# basic variables, change before release
AEGIR_VERSION="HEAD"
......@@ -41,28 +40,6 @@ msg() {
echo "==> $*"
}
# simple prompt
prompt_yes_no() {
while true ; do
printf "$* [Y/n] "
read answer
if [ -z "$answer" ] ; then
return 0
fi
case $answer in
[Yy]|[Yy][Ee][Ss])
return 0
;;
[Nn]|[Nn][Oo])
return 1
;;
*)
echo "Please answer yes or no"
;;
esac
done
}
########################################################################
# Main script
......@@ -70,25 +47,11 @@ AEGIR_HOME="$HOME"
AEGIR_HOST=`uname -n`
DRUSH="$AEGIR_HOME/drush/drush.php"
msg "Aegir $AEGIR_VERSION automated install script"
if [ `whoami` = "root" ] ; then
msg "This script should be ran as a non-root user"
exit 1
fi
cat <<EOF
* you have read INSTALL.txt and prepared the platform accordingly
* you are executing this script as your "aegir" user
EOF
if prompt_yes_no "Do you want to proceed with the install?" ; then
true
else
echo "installation aborted by user"
exit 1
fi
# we need to check both because some platforms (like SunOS) return 0 even if the binary is not found
if which drush 2> /dev/null && which drush | grep -v 'no drush in' > /dev/null; then
msg "Drush is in the path, good"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment