I'm working on a bash script to restart multiple apache instances in different environments. It's working fine except I'd like to add some logic to ensure only correct arguments are entered. I've tried the below statement in multiple ways, but I'm not having any luck. Any suggestions?
if [[ $ENVT != qa || $ENVT != qa2 || $ENVT != stageqa || $ENVT != stage ]]; then usage fi
It's when I use the stage environment it's evaluating the first option and invoking the function instead of iterating through as seen with
set -x turned on.
+ ENVT=stage + ACTION=stop + USER=www + '[' 2 -ne 2 ']' + [[ stage != qa ]] + usage