Repository: incubator-ranger Updated Branches: refs/heads/master 937613250 -> 62689c3c8
RANGER-1275:At the beginning of the security-admin/scripts/setup.sh file there are three logical errors. Signed-off-by: Colm O hEigeartaigh <cohei...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/62689c3c Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/62689c3c Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/62689c3c Branch: refs/heads/master Commit: 62689c3c80b7143309fa3de48202060926ac6025 Parents: 9376132 Author: zhangqiang2 <zhangqia...@zte.com.cn> Authored: Wed Dec 21 23:21:19 2016 +0800 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Thu Dec 22 12:44:22 2016 +0000 ---------------------------------------------------------------------- security-admin/scripts/setup.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/62689c3c/security-admin/scripts/setup.sh ---------------------------------------------------------------------- diff --git a/security-admin/scripts/setup.sh b/security-admin/scripts/setup.sh index 2ec26f7..82250b1 100755 --- a/security-admin/scripts/setup.sh +++ b/security-admin/scripts/setup.sh @@ -19,14 +19,6 @@ # # This script will install policymanager webapplication under tomcat and also, initialize the database with ranger users/tables. -PROPFILE=$PWD/install.properties -pidFolderName='/var/run/ranger' -mkdir -p ${pidFolderName} -propertyValue='' -if [ ! $? = "0" ];then - log "$PROPFILE file not found....!!"; - exit 1; -fi usage() { [ "$*" ] && echo "$0: $*" sed -n '/^##/,/^$/s/^## \{0,1\}//p' "$0" @@ -50,6 +42,20 @@ get_prop(){ fi } +PROPFILE=$PWD/install.properties +if [ ! -f "${PROPFILE}" ]; then + echo "$PROPFILE file not found....!!" + exit 1; +fi + +LOGFILE=$(eval echo " $(get_prop 'LOGFILE' $PROPFILE)") +pidFolderName='/var/run/ranger' +mkdir -p ${pidFolderName} +if [ ! $? = "0" ];then + log "Make $pidFolderName failure....!!"; + exit 1; +fi + PYTHON_COMMAND_INVOKER=$(get_prop 'PYTHON_COMMAND_INVOKER' $PROPFILE) DB_FLAVOR=$(get_prop 'DB_FLAVOR' $PROPFILE) SQL_CONNECTOR_JAR=$(get_prop 'SQL_CONNECTOR_JAR' $PROPFILE) @@ -96,7 +102,6 @@ xa_ldap_ad_userSearchFilter=$(get_prop 'xa_ldap_ad_userSearchFilter' $PROPFILE) XAPOLICYMGR_DIR=$(eval echo "$(get_prop 'XAPOLICYMGR_DIR' $PROPFILE)") app_home=$(eval echo "$(get_prop 'app_home' $PROPFILE)") TMPFILE=$(eval echo "$(get_prop 'TMPFILE' $PROPFILE)") -LOGFILE=$(eval echo " $(get_prop 'LOGFILE' $PROPFILE)") LOGFILES=$(eval echo "$(get_prop 'LOGFILES' $PROPFILE)") JAVA_BIN=$(get_prop 'JAVA_BIN' $PROPFILE) JAVA_VERSION_REQUIRED=$(get_prop 'JAVA_VERSION_REQUIRED' $PROPFILE) @@ -1198,4 +1203,4 @@ else exit 1 fi $PYTHON_COMMAND_INVOKER db_setup.py -javapatch -echo "Installation of Ranger PolicyManager Web Application is completed." \ No newline at end of file +echo "Installation of Ranger PolicyManager Web Application is completed."