summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Eiselt <herbert.eiselt@highstreet-technologies.com>2019-03-28 09:15:11 +0100
committerHerbert Eiselt <herbert.eiselt@highstreet-technologies.com>2019-03-28 09:15:58 +0100
commita3754c2a86ec83bf7c1f0df7e99bb139153621c7 (patch)
treef9962fd295a11002045deedd11a614da24a11c65
parentb47edc477e8604a8f5e53c403bffdf8ce248f779 (diff)
Provide SDNR for SDNC
Provide optional sdnr wt feature for start script Change-Id: Id73d5b6caeb1f6b5630b4ef20e3a7e54080ab87f Issue-ID: SDNC-692 Signed-off-by: Herbert Eiselt <herbert.eiselt@highstreet-technologies.com> Former-commit-id: b3d343e22163fc525747bbb4a52745b15a899aff
-rwxr-xr-xinstallation/sdnc/src/main/scripts/startODL.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/installation/sdnc/src/main/scripts/startODL.sh b/installation/sdnc/src/main/scripts/startODL.sh
index 73e3eaa7..09876252 100755
--- a/installation/sdnc/src/main/scripts/startODL.sh
+++ b/installation/sdnc/src/main/scripts/startODL.sh
@@ -21,6 +21,26 @@
# ============LICENSE_END=========================================================
###
+# Append features to karaf boot feature configuration
+# $1 additional feature to be added
+# $2 repositories to be added (optional)
+function addToFeatureBoot() {
+ CFG=$ODL_HOME/etc/org.apache.karaf.features.cfg
+ ORIG=$CFG.orig
+ if [ -n "$2" ] ; then
+ echo "Add repository: $2"
+ mv $CFG $ORIG
+ cat $ORIG | sed -e "\|featuresRepositories|s|$|,$2|" > $CFG
+ fi
+ echo "Add boot feature: $1"
+ mv $CFG $ORIG
+ cat $ORIG | sed -e "\|featuresBoot *=|s|$|,$1|" > $CFG
+}
+
+function install_sdnrwt_features() {
+ addToFeatureBoot "$SDNRWT_BOOTFEATURES" $SDNRWT_REPOSITORY
+}
+
function enable_odl_cluster(){
if [ -z $SDNC_REPLICAS ]; then
echo "SDNC_REPLICAS is not configured in Env field"
@@ -81,6 +101,14 @@ ENABLE_ODL_CLUSTER=${ENABLE_ODL_CLUSTER:-false}
IS_PRIMARY_CLUSTER=${IS_PRIMARY_CLUSTER:-false}
MY_ODL_CLUSTER=${MY_ODL_CLUSTER:-127.0.0.1}
INSTALLED_DIR=${INSTALLED_FILE:-/opt/opendaylight/current/daexim}
+SDNRWT=${SDNRWT:-false}
+SDNRWT_BOOTFEATURES=${SDNRWT_BOOTFEATURES:-sdnr-wt-feature-aggregator}
+
+
+echo "Settings:"
+echo " ENABLE_ODL_CLUSTER=$ENABLE_ODL_CLUSTER"
+echo " SDNC_REPLICAS=$SDNC_REPLICAS"
+echo " SDNRWT=$SDNRWT"
#
# Wait for database
@@ -115,6 +143,8 @@ then
if $ENABLE_ODL_CLUSTER ; then enable_odl_cluster ; fi
+ if $SDNRWT ; then install_sdnrwt_features ; fi
+
echo "Installed at `date`" > ${INSTALLED_DIR}/.installed
fi