update instance-init.sh
[vfc/nfvo/driver/vnfm/svnfm.git] / nokia / vnfmdriver / vfcadaptorservice / docker / instance-config.sh
index ce9d31d..1631cc5 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright 2017 Huawei Technologies Co., Ltd.
+# Copyright 2017, Nokia Corporation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 #
 # Config MSB address
 MSB_IP=`echo $MSB_ADDR | cut -d: -f 1`
-sed -i "s|127\.0\.0\.1|${MSB_IP}|" etc/conf/restclient.json
+MSB_PORT=`echo $MSB_ADDR | cut -d: -f 2`
+
+if [ $MSB_PORT ]; then
+  sed -i "s|127\.0\.0\.1|${MSB_IP}|" etc/conf/restclient.json
+fi
+
+if [ $MSB_PORT ]; then
+  sed -i "s|80|${$MSB_PORT}|" etc/conf/restclient.json
+fi
+
 cat etc/conf/restclient.json
 
 # Set self IP