You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ma...@apache.org on 2015/02/04 22:36:46 UTC
incubator-ranger git commit: RANGER-203: plugin-installtion script
(enable-agent.sh) updated to read properties from
-plugin-install.properties file, in addition to install.properties.
Repository: incubator-ranger
Updated Branches:
refs/heads/stack 760e5f74d -> 0b4363df7
RANGER-203: plugin-installtion script (enable-agent.sh) updated to read
properties from <type>-plugin-install.properties file, in addition to
install.properties.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/0b4363df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/0b4363df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/0b4363df
Branch: refs/heads/stack
Commit: 0b4363df72b1d3ea4c886d447c90fef507873e39
Parents: 760e5f7
Author: Madhan Neethiraj <ma...@apache.org>
Authored: Wed Feb 4 13:36:31 2015 -0800
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Wed Feb 4 13:36:31 2015 -0800
----------------------------------------------------------------------
agents-common/scripts/enable-agent.sh | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/0b4363df/agents-common/scripts/enable-agent.sh
----------------------------------------------------------------------
diff --git a/agents-common/scripts/enable-agent.sh b/agents-common/scripts/enable-agent.sh
index ebaca12..727a827 100755
--- a/agents-common/scripts/enable-agent.sh
+++ b/agents-common/scripts/enable-agent.sh
@@ -16,7 +16,22 @@
# limitations under the License.
function getInstallProperty() {
- grep "^$1" ${INSTALL_ARGS} | awk -F= '{ sub("^[ \t]*", "", $2); sub("[ \t]*$", "", $2); print $2 }'
+ local propertyName=$1
+ local propertyValue=""
+
+ for file in "${COMPONENT_INSTALL_ARGS}" "${INSTALL_ARGS}"
+ do
+ if [ -f "${file}" ]
+ then
+ propertyValue=`grep "^${propertyName}" ${file} | awk -F= '{ sub("^[ \t]*", "", $2); sub("[ \t]*$", "", $2); print $2 }'`
+ if [ "${propertyValue}" != "" ]
+ then
+ break
+ fi
+ fi
+ done
+
+ echo ${propertyValue}
}
#
@@ -103,6 +118,7 @@ DEFAULT_XML_CONFIG=${PROJ_INSTALL_DIR}/install/conf.templates/default/configurat
PROJ_LIB_DIR=${PROJ_INSTALL_DIR}/lib
PROJ_INSTALL_LIB_DIR="${PROJ_INSTALL_DIR}/install/lib"
INSTALL_ARGS="${PROJ_INSTALL_DIR}/install.properties"
+COMPONENT_INSTALL_ARGS="${PROJ_INSTALL_DIR}/${COMPONENT_NAME}-install.properties"
JAVA=$JAVA_HOME/bin/java
HCOMPONENT_INSTALL_DIR_NAME=$(getInstallProperty 'COMPONENT_INSTALL_DIR_NAME')