Hi Krishantha. This is really useful. Does it guarantee that the wso2 server has fully started?
On Mon, Jun 2, 2014 at 10:03 AM, Krishantha Samaraweera <krishan...@wso2.com> wrote: > > Hi, > > On Mon, Jun 2, 2014 at 2:23 PM, Sajini De Silva <saj...@wso2.com> wrote: >> >> Hi, >> >> Thank you for the quick reply chirs. >> >> I figured out that this is happening because wso2server.sh command does >> not release the terminal. Therefore i edited the code like below and now its >> working. >> >> sh ./wso2server.sh & >> sleep 20 >> >> echo "The script exited with status $?" >> [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd` >> echo $CARBON_HOME >> sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p >> admin >> >> cp $CARBON_HOME/repository/cloud/profile1 >> _system/config/bamServerProfiles/ >> cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/ >> sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1 >> sh ./checkin-client.sh add _system/governance/oidlist.txt >> sh ./checkin-client.sh ci -u admin -p admin >> >> >> Does anyone know another way of doing this without having the sleep >> command? > > > Wait for the port to open would help > > while ! echo exit | nc localhost 9445; do sleep 10; done > > Thanks, > Krishantha. >> >> >> Thank you, >> Sajini. >> >> >> >> On Mon, Jun 2, 2014 at 2:02 PM, chris snow <chsnow...@gmail.com> wrote: >>> >>> What command in the wso2server.sh script failing? You could use the >>> '-x' flag to debug: >>> >>> ... >>> >>> CMD="$CMD -Desb.sample=cloud >>> -Dcarbon.registry.root=../cloud/esb-samples/scloud" >>> #sh $PRGDIR/wso2server.sh$CMD >>> bash -x ./wso2server.sh >>> >>> echo "The script exited with status $?" >>> ... >>> >>> >>> >>> >>> On Mon, Jun 2, 2014 at 9:13 AM, Sajini De Silva <saj...@wso2.com> wrote: >>> > Hi, >>> > >>> > This is what my script file looks like, >>> > >>> > PRG="$0" >>> > >>> > while [ -h "$PRG" ]; do >>> > echo $PRG >>> > ls=`ls -ld "$PRG"` >>> > link=`expr "$ls" : '.*-> \(.*\)$'` >>> > if expr "$link" : '.*/.*' > /dev/null; then >>> > PRG="$link" >>> > else >>> > PRG=`dirname "$PRG"`/"$link" >>> > fi >>> > done >>> > >>> > # Get standard environment variables >>> > PRGDIR=`dirname "$PRG"` >>> > >>> > # ----- Process the input command >>> > ---------------------------------------------- >>> > CMD="" >>> > >>> > CMD="$CMD -Desb.sample=cloud >>> > -Dcarbon.registry.root=../cloud/esb-samples/scloud" >>> > #sh $PRGDIR/wso2server.sh$CMD >>> > sh ./wso2server.sh >>> > echo "The script exited with status $?" >>> > [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd` >>> > echo $CARBON_HOME >>> > sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p >>> > admin >>> > >>> > cp $CARBON_HOME/repository/cloud/profile1 >>> > _system/config/bamServerProfiles/ >>> > cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/ >>> > sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1 >>> > sh ./checkin-client.sh add _system/governance/oidlist.txt >>> > sh ./checkin-client.sh ci -u admin -p admin >>> > >>> > >>> > >>> > On Mon, Jun 2, 2014 at 1:36 PM, Sajini De Silva <saj...@wso2.com> >>> > wrote: >>> >> >>> >> Hi, >>> >> >>> >> I want to start the esb server from a script file and execute some >>> >> check-in client commands from the same script, but once wso2server.sh >>> >> is >>> >> executed in the script it never return to the next line where other >>> >> script >>> >> commands are placed. Therefore my other script commands are not >>> >> executed. >>> >> >>> >> Any suggestions on why it is happening? >>> >> >>> >> Thank you, >>> >> Sajini. >>> >> -- >>> >> Sajini De SIlva >>> >> Software Engineer; WSO2 Inc.; http://wso2.com , >>> >> Email: saj...@wso2.com >>> >> Blog: http://sajinid.blogspot.com/ >>> >> Git hub profile: https://github.com/sajinidesilva >>> >> >>> > >>> > >>> > >>> > -- >>> > Sajini De SIlva >>> > Software Engineer; WSO2 Inc.; http://wso2.com , >>> > Email: saj...@wso2.com >>> > Blog: http://sajinid.blogspot.com/ >>> > Git hub profile: https://github.com/sajinidesilva >>> > >>> > >>> > _______________________________________________ >>> > Dev mailing list >>> > Dev@wso2.org >>> > http://wso2.org/cgi-bin/mailman/listinfo/dev >>> > >>> >>> >>> >>> -- >>> Check out my professional profile and connect with me on LinkedIn. >>> http://lnkd.in/cw5k69 >> >> >> >> >> -- >> Sajini De SIlva >> Software Engineer; WSO2 Inc.; http://wso2.com , >> Email: saj...@wso2.com >> Blog: http://sajinid.blogspot.com/ >> Git hub profile: https://github.com/sajinidesilva >> >> >> _______________________________________________ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> > > > > -- > Krishantha Samaraweera > Senior Technical Lead - Test Automation > Mobile: +94 77 7759918 > WSO2, Inc.; http://wso2.com/ > lean . enterprise . middlewear. > > _______________________________________________ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > -- Check out my professional profile and connect with me on LinkedIn. http://lnkd.in/cw5k69 _______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev