Hi Nirmal,
I would like to make a small change to the stratos installer script so
that it can run headless. The changes are shown in the diff below,
and add an option [-s] to start servers. If the option is set, the
user will not be prompted.
Are you happy for me to commit this change?
Many thanks,
Chris
===
diff --git a/tools/stratos-installer/stratos-setup.sh
b/tools/stratos-installer/stratos-setup.sh
index 11e9d4d..a65fa40 100755
--- a/tools/stratos-installer/stratos-setup.sh
+++ b/tools/stratos-installer/stratos-setup.sh
@@ -39,19 +39,21 @@ cep="false"
product_list="mb;cc;cep;as;sm"
enable_internal_git=false
activemq_client_libs=(activemq-broker-5.8.0.jar
activemq-client-5.8.0.jar geronimo-j2ee-management_1.1_spec-1.0.1.jar
geronimo-jms_1.1_spec-1.1.1.jar hawtbuf-1.2.jar)
+auto_start_servers="false"
function help {
echo ""
echo "Usage:"
- echo "stratos-setup.sh -u <host username> -p \"all\""
+ echo "stratos-setup.sh -u <host username> -p \"all\" [-s]"
echo "Example:"
echo "sudo ./setup.sh -p \"all\""
echo ""
echo "-u: <host username> The login user of the host."
+ echo "-s: Start servers after installation."
echo ""
}
-while getopts u:p:g: opts
+while getopts u:p:g:s opts
do
case $opts in
p)
@@ -60,6 +62,9 @@ do
g)
enable_internal_git=${OPTARG}
;;
+ s)
+ auto_start_servers="true"
+ ;;
\?)
help
exit 1
@@ -625,9 +630,11 @@ chown $host_user:$host_user $stratos_path -R
echo "Apache Stratos setup has successfully completed"
-read -p "Do you want to start the servers [y/n]? " answer
-if [[ $answer != y ]] ; then
- exit 1
+if [[ $auto_start_servers != "true" ]]; then
+ read -p "Do you want to start the servers [y/n]? " answer
+ if [[ $answer != y ]] ; then
+ exit 1
+ fi
fi
echo "Starting the servers" >> $LOG
===