Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

case question

Status
Not open for further replies.

grazinggoat

Programmer
Mar 12, 2008
41
US

Looking for thoughts on good programming...
in my case i want to be able to do both a stop and start with the restart
call. is it wise to have my var RUNCMD for both calls ?

case ${COMMAND} in
stop)
RUNCMD=stop
;;
start)
RUNCMD=start
;;

restart)
RUNCMD=stop
RUNCMD=start
;;
status)
RUNCMD=status
;;
esac
 
i solved this...

I wrapped the restart with an if

Code:
 restartll)
                        if [[ ${COMMAND} = "restart" ]]
                        then
                              ${COMMAND}="stopall"
                              sleep ${SLEEPTIME}
                              ${COMMAND}="startall"
                        fi
                        ;;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top