need help with a shell script,

Hello,

I have a script that I coded with the help of EE, and made some changes and now it keeps dying with:

# ./appstart.new
./appstart.new[32]: 0403-057 Syntax error at line 56 : `}' is not expected.


#!/bin/ksh

# Changes:
# 12-09-11 - mirde - Updated script to support multiple AdminServers.

WRKDIR=/usr1/logs/appsrv

startProduction() {
        startServer PRODUCTION 20931 7842
        startApp 20931 cfgmgrp production productiona
}

startDevelopment() {
        startServer DEVELOPMENT 20932 7843
        startApp 20932 fgmgrd development developmenta
}

startTest() {
        startServer TESTING 20934 7845
        startApp 20934 cfgmgrs testing testinga
}

startTraining() {
        startServer TRAINING 20933 7844
        startApp 20933 cfgmgrt training traininga
}

startCfg() {
        startCfgMan 20931 cfgmgr
}

startServer() {
        environ=$1
        port=$2
        adminport=$3

        cd $WRKDIR
        echo "Starting the $environ AdminServer on `date`."
        ${DLC}/bin/proadsv -port $port -adminport $adminport -start

        echo "Waiting for good start from AdminServer."
        STAT=bad
        tries=0
        while [ "${STAT}" != "good" ]; do
          let "tries=tries+1"
          [ $tries -gt 3 ] && exit
         
                echo "Checking the $environ AdminServer on `date`"
                ${DLC}/bin/proadsv -port $port -query
                case "`${DLC}/bin/proadsv -port $port -query`" in
                 *not?alive*) STAT=bad;;
                 *alive*) STAT=good;;
                 *) STAT=bad;;
                esac
}

startApp() {
        port=$1
        cfgmgr=$2
        regular=$3
        async=$4

        cd $WRKDIR
        echo "Starting AppServers at `date` ..."
        ${DLC}/bin/asbman -name $cfgmgr -port $port -start
        ${DLC}/bin/asbman -name $regular -port $port -start
        ${DLC}/bin/asbman -name $async -port $port -start
}

startCfgMan() {
        port=$1
        cfgmgr=$2
        ${DLC}/bin/asbman -name $cfgmgr -port $port -start
}


if [[ ! -n $1 ]] ; then
 echo " You did not specify an environment."
 echo " Call the script with: appstart [env]"
 echo " Valid ENV values: devel prod train test all"
 exit 99
fi

opt=$1
case "$opt" in
 production|prod|live)
        startProduction
;;
 development|devel)
        startDevelopment
;;
 testing|test)
        startTesting
;;
  training|train)
        startTraining
;;
  all)
        startDevelopment
        startTesting
        startTraining
        startProduction
        startCfg
;;
 *) clear
 echo "Your syntax is incorrect!" ; exit 99;;
esac

echo "AppServer startup completed at `date`"

Open in new window


When I look at line 56, makes sense to have the "}" there does it not? Maybe I need more coffee.

Any help appreciated.
mirdeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
where is the end of
while [ "${STAT}" != "good" ]; do
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mirdeAuthor Commented:
doh!

right after esac..

thx :)
0
omarfaridCommented:
as ozo said, while loop is not complete. add

done

after line 54 (insert new line)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.