Description
The install.sh will print 'Command not found' when installing the solr audit log module, as follow:
[root@wkh001 solr_for_audit_setup]# ./setup.sh ./setup.sh: line 29: log: Command not found
Then I analyse the install.sh, there is one error code, as follow:
if test -z "$validateProperty" ; then log "[E] '$1' not found in $2 file while getting....!!"; exit 1; fi
Because the function log is undefined, and in other places, we use echo to print log, We need to be unified as 'echo'.
When I modify this bug, then execute setup.sh, it shows another error, as follow:
setup.sh: line 68:[: Too many parameters
Then I find another logic bug, if you don't config JAVA_HOME in install.properties, CONFIG_JAVA_HOME will get an error message and influence subsequent processe.
CONFIG_JAVA_HOME=$(get_prop 'JAVA_HOME' $PROPFILE)
JAVA_HOME=${CONFIG_JAVA_HOME:-$JAVA_HOME}
So I modified two places, and test in three scenes, first is that JAVA_HOME is nonexistent, second is that JAVA_HOME is not configured, like 'JAVA_HOME=', third is that JAVA_HOME is configured.
Please check my patch, thanks.