Repository: ranger Updated Branches: refs/heads/master 7fc74fccc -> 543b9ff00
RANGER-1846:This JAVA_VERSION_REQUIRED configuration item is invalid in security admin installer, we should enable it to control the necessary java version. Signed-off-by: zhangqiang2 <zhangqia...@zte.com.cn> Project: http://git-wip-us.apache.org/repos/asf/ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/543b9ff0 Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/543b9ff0 Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/543b9ff0 Branch: refs/heads/master Commit: 543b9ff006da4f64b951e2f6c0a6b16d9b703f22 Parents: 7fc74fc Author: peng.jianhua <peng.jian...@zte.com.cn> Authored: Tue Oct 24 16:36:04 2017 +0800 Committer: zhangqiang2 <zhangqia...@zte.com.cn> Committed: Thu Oct 26 20:29:10 2017 -0400 ---------------------------------------------------------------------- security-admin/scripts/setup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ranger/blob/543b9ff0/security-admin/scripts/setup.sh ---------------------------------------------------------------------- diff --git a/security-admin/scripts/setup.sh b/security-admin/scripts/setup.sh index 468e8a0..19008fb 100755 --- a/security-admin/scripts/setup.sh +++ b/security-admin/scripts/setup.sh @@ -304,10 +304,12 @@ check_java_version() { major=`echo ${version} | cut -d. -f1` minor=`echo ${version} | cut -d. -f2` current_java_version="$major.$minor" - if [[ "$current_java_version" != "$JAVA_VERSION_REQUIRED" ]];then - log "[E] Java $JAVA_VERSION_REQUIRED is required, current java version is $version" + num_current_java_version=`echo $current_java_version|awk ' { printf("%3.2f\n", $0); } '` + num_required_java_version=`echo $JAVA_VERSION_REQUIRED|awk ' { printf("%3.2f\n", $0); } '` + if [ `echo "$num_current_java_version < $num_required_java_version" | bc` -eq 1 ];then + log "[E] The java version must be greater than or equal to $JAVA_VERSION_REQUIRED, the current java version is $version" exit 1; - fi + fi } sanity_check_files() {