-function editakkaconf
-{
-set -x
- echo "##### editakkaconf #####"
- echo "The number of args recieved \${#} \${1} \${2}"
-# Expects 2 argument \$LOOPINCR and IPADDRESS of controller.
-# \$CONTROLLERIPS[] is set by getslaveaddresses().
-# \$BUNDLEFOLDER is set in "include-raw-integration-deploy-controller.sh"
-# A single copy of akka.conf is assumed to be available in \$BUNDLEFOLDER
-
-if [ -z ${BUNDLEFOLDER} ] || [ -f ${BUNDLEFOLDER} ]; then
- echo "WARNING: Location of ODL BUNDLEFOLDER:\$BUNDLEFOLDER is not defined"
-
-fi
-if [ -z \${CONTROLLERIPS} ]; then
- echo "WARNING: Cluster IPs not known due to UNBOUND varible: CONTROLLERIPS[@] does not exist"
- echo "WARNING: Calling getslaveaddresses to populate CONTROLLERIPS[@]"
- getslaveaddresses
-fi
-
-
-
-
-############################
-# BEGIN function variables #
-############################
-
- # make local copies of global varibles because globals may produce interesting bugs.
- echo "# set the IP of the current controller."
-
- local LOOPINCR=\$1
- local CURRENTCONTROLLERIPADDR=\$2
- local AKKACONF=\$(find /tmp/${BUNDLEFOLDER} -name akka.conf)
-
- # used to verify IP address of current VM
- local HOSTIPADDR0=\$(/sbin/ifconfig eth0 | grep "inet " | awk '{print \$2}' | awk '{print \$1}')
- local HOSTIPADDR=\${HOSTIPADDR0#'addr:'}
- local TEMPIP = \$(/sbin/ifconfig eth0 | grep "inet " | awk '{print \$0}' )
- local CLUSTERDATAORIG="\"akka.tcp:\/\/opendaylight-cluster-data@127.0.0.1:2550"\"
- local CLUSTERDATANEW="\"akka.tcp:\/\/opendaylight-cluster-data@$CONTROLLER0:2550\",\"akka.tcp:\/\/opendaylight-cluster-data@$CONTROLLER1:2550\",\"akka.tcp:\/\/opendaylight-cluster-data@$CONTROLLER2:2550"\"
-
- local CLUSTERRPCORIG="\"akka.tcp:\/\/odl-cluster-rpc@127.0.0.1:2551"\"
- local CLUSTERRPCNEW="\"akka.tcp:\/\/odl-cluster-rpc@$CONTROLLER0:2551\",\"akka.tcp:\/\/odl-cluster-rpc@$CONTROLLER1:2551\",\"akka.tcp:\/\/odl-cluster-rpc@$CONTROLLER2:2551\""
-
- local UIDORIG="member-1"
- local UIDNEW="member-\$1"
-
-##########################
-# END function variables #
-##########################
-
-#####################################
-# sanity test hostname in akka.conf #
-#####################################
-# probably overkill as SCP depends on IPaddress being correct.
-
-#set -x
- if [ -z \${HOSTIPADDR} ]; then
- echo "WARNING: HOSTIPADDR is empty."
- fi
-
-#set +x
-
- if [ "\${CURRENTCONTROLLERIPADDR}" == "\${HOSTIPADDR}" ]
- then
- echo "CURRENTCONTROLLERIPADRR:\${CURRENTCONTROLLERIPADDR} == HOSTIPADDR:\${HOSTIPADDR}"
- else
- echo "WARNING: CURRENTCONTROLLERIPADRR:\${CURRENTCONTROLLERIPADDR} != HOSTIPADDR:\${HOSTIPADDR}"
- fi
-
-####################################
-# configure hostname in akka.conf #
-####################################
-
- cp \${AKKACONF} \${AKKACONF}.bak
- sed -ri "s:hostname = \"([0-9]{1,3}[\.]){3}[0-9]{1,3}\":hostname = \
-\$HOSTIPADDR:" \${AKKACONF}.bak
-
-####################################
-# configure seednode in akka.conf #
-####################################
-
- sed -i "s/\$CLUSTERDATAORIG/\$CLUSTERDATANEW/g" \${AKKACONF}.bak
- sed -i "s/\$CLUSTERRPCORIG/\$CLUSTERRPCNEW/g" \${AKKACONF}.bak
-
-####################################
-# define unique name for each node #
-####################################