diff --git a/msctl b/msctl index bf8642f..ddb6fb5 100755 --- a/msctl +++ b/msctl @@ -358,14 +358,21 @@ getJavaMemory() { true_value() { local VALUE VALUE=$(echo "$1" | tr '[:upper:]' '[:lower:]') + # Look for TRUE values. if [ "$VALUE" = "1" ] || [ "$VALUE" = "true" ] || [ "$VALUE" = "yes" ] || [ "$VALUE" = "on" ]; then # Return a true value (success). return 0 fi + # Look for FALSE values. if [ "$VALUE" = "0" ] || [ "$VALUE" = "false" ] || [ "$VALUE" = "no" ] || [ "$VALUE" = "off" ]; then # Return a false value (failure). return 1 fi + # Assume FALSE if value is not defined. + if [ "$VALUE" = "" ]; then + # Return a false value (failure). + return 1 + fi printf "Invalid true/false value: \"$1\"\n" >&2 # Return a false value (failure) in case of invalid true/false input. return 1