2 ##############################################################################
3 # - Copyright 2012, 2016 AT&T Intellectual Properties
4 ##############################################################################
6 ROOT_DIR=${INSTALL_ROOT}/${distFilesRootDirPath}
7 LOGGING_PROP_FILE=${ROOT_DIR}/etc/log4j.properties
8 RUN_FILE=${ROOT_DIR}/etc/tconn.sh
12 mkdir -p logs || fail 1 "Error on creating the logs directory."
13 mkdir -p back || fail 1 "Error on creating the back directory."
14 chmod 777 back || fail 1 "Error on creating the back directory."
17 # Some Functions that Vastly cleanup this install file...
18 # You wouldn't believe how ugly it was before. Unreadable... JG
28 # Set the "SED" replacement for this Variable. Error if missing
29 # Note that Variable in the Template is surrounded by "_" i.e. _ROOT_DIR_
35 ERRS+="\n\t$1 must be set for this installation"
37 SED_E+=" -e s|$1|$2|g"
41 # Set the "SED" replacement for this Variable. Use Default (3rd parm) if missing
42 # Note that Variable in the Template is surrounded by "_" i.e. _ROOT_DIR_
49 SED_E+=" -e s|$1|$3|g"
51 SED_E+=" -e s|$1|$2|g"
55 # Linux requires this. Mac blows with it. Who knows if Windoze even does SED
56 if [ -z "$SED_OPTS" ]; then
64 # Use "default" function if there is a property that isn't required, but can be defaulted
65 # use "required" function if the property must be set by the environment
67 required _ROOT_DIR_ ${ROOT_DIR}
68 default _COMMON_DIR_ ${COMMON_DIR} ${ROOT_DIR}/../../common
69 required _AFT_ENVIRONMENT_ ${AFT_ENVIRONMENT}
70 required _ENV_CONTEXT_ ${ENV_CONTEXT}
71 required _HOSTNAME_ ${HOSTNAME}
72 required _ARTIFACT_ID_ ${artifactId}
73 required _ARTIFACT_VERSION_ ${version}
75 # Specifics for Service
76 if [ "${artifactId}" = "authz-service" ]; then
77 default _AUTHZ_SERVICE_PORT_ ${PORT} 0
78 required _AUTHZ_CASS_CLUSTERS_ ${AUTHZ_CASS_CLUSTERS}
79 required _AUTHZ_CASS_PORT_ ${AUTHZ_CASS_PORT}
80 required _AUTHZ_CASS_PWD_ ${AUTHZ_CASS_PWD}
81 default _AUTHZ_CASS_USER_ ${AUTHZ_CASS_USER} authz
82 required _AUTHZ_KEYSTORE_PASSWORD_ ${AUTHZ_KEYSTORE_PASSWORD}
83 required _AUTHZ_KEY_PASSWORD_ ${AUTHZ_KEY_PASSWORD}
84 required _SCLD_PLATFORM_ ${SCLD_PLATFORM}
87 default _EMAIL_FROM_ ${EMAIL_FROM} authz@ems.att.com
88 default _EMAIL_HOST_ ${EMAIL_HOST} mailhost.att.com
89 default _ROUTE_OFFER_ ${ROUTE_OFFER} BAU_SE
90 default _DME_TIMEOUT_ ${DME_TIMEOUT} 3000
92 # Choose defaults for log level and logfile size
93 if [ "${SCLD_PLATFORM}" = "PROD" ]; then
96 default _LOG4J_LEVEL_ ${LOG4J_LEVEL} INFO
97 default _LOG4J_SIZE_ ${LOG4J_SIZE} 10000KB
98 default _LOG_DIR_ ${LOG_DIR} ${ROOT_DIR}/logs
99 default _MAX_LOG_FILE_SIZE_ ${MAX_LOG_FILE_SIZE} 10000KB
100 default _MAX_LOG_FILE_BACKUP_COUNT_ ${MAX_LOG_FILE_BACKUP_COUNT} 7
101 default _RESOURCE_MIN_COUNT_ ${RESOURCE_MIN_COUNT} 1
102 default _RESOURCE_MAX_COUNT_ ${RESOURCE_MAX_COUNT} 1
104 required _LOGGING_PROP_FILE_ ${LOGGING_PROP_FILE}
105 required _AFT_LATITUDE_ ${LATITUDE}
106 required _AFT_LONGITUDE_ ${LONGITUDE}
107 required _HOSTNAME_ ${HOSTNAME}
110 default _MAJOR_VER_ "`expr ${version} : '\([0-9]*\)\..*'`"
111 default _MINOR_VER_ "`expr ${version} : '[0-9]*\.\([0-9]*\)\..*'`"
112 default _PATCH_VER_ "`expr ${version} : '[0-9]\.[0-9]*\.\(.*\)'`"
116 # Now Fail if Required items are not set...
117 # Report all of them at once!
118 if [ "${ERRS}" != "" ] ; then
124 for i in ${PROPERTIES_FILE} ${LRM_XML} ${LOGGING_PROP_FILE} ${RUN_FILE} ; do
128 sed ${SED_E} -i'.sed' ${i} || fail 8 "could not sed ${i} "
129 mv -f ${i}.sed ${ROOT_DIR}/back
135 # Add the resource to LRM using the newly created/substituted XML file.
137 # Note: No LRM for authz-test
138 #if [ -r ${LRM_XML} ]; then
139 # ${LRM_HOME}/bin/lrmcli -addOrUpgrade -file ${LRM_XML} || fail 1 "Add to LRM Failed"
140 # ${LRM_HOME}/bin/lrmcli -start -name com.att.authz.${artifactId} -version ${version} -routeoffer ${ROUTE_OFFER} | grep SUCCESS
143 # Note: Must exit 0 or, it will be exit default 1 and fail