Hi Chris, I made some changes in stratos-setup.sh to support for multi-profiles. I that case I added some prompting due to following scenarios.
- When using default profile, user will be able to use pre-configured activemq. In that case user will be prompted whether user want to configure ActiveMQ or need to use pre-configured activemq. - When using profiles such as autoscalar(as) and stratos manager (sm), it depend on the host-names and ips of other components. in that case user will be prompted to get required informations. Do I need to skip those prompts? is it fine to keep those as it is? Thanks On Thu, Mar 27, 2014 at 10:48 PM, Nirmal Fernando <[email protected]>wrote: > Absolutely Chris! Thanks. > > > On Thu, Mar 27, 2014 at 10:41 PM, chris snow <[email protected]> wrote: > >> 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 >> === >> > > > > -- > Best Regards, > Nirmal > > Nirmal Fernando. > PPMC Member & Committer of Apache Stratos, > Senior Software Engineer, WSO2 Inc. > > Blog: http://nirmalfdo.blogspot.com/ > -- *Dinesh Bandara* Software Engineer WSO2 Inc.; http://wso2.com lean.enterprise.middleware
