3 REPO_URL_BLOB=$(cat /opt/config/repo_url_blob.txt)
4 INSTALL_SCRIPT_VERSION=$(cat /opt/config/install_script_version.txt)
5 CLOUD_ENV=$(cat /opt/config/cloud_env.txt)
7 # OpenStack network configuration
8 if [[ $CLOUD_ENV == "openstack" ]]
10 echo 127.0.0.1 $(hostname) >> /etc/hosts
11 MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
13 VSN_PRIVATE_IP_O=$(cat /opt/config/vsn_private_ip_0.txt)
14 echo "auto eth1" >> /etc/network/interfaces
15 echo "iface eth1 inet static" >> /etc/network/interfaces
16 echo " address $VSN_PRIVATE_IP_O" >> /etc/network/interfaces
17 echo " netmask 255.255.255.0" >> /etc/network/interfaces
18 echo " mtu $MTU" >> /etc/network/interfaces
20 VSN_PRIVATE_IP_1=$(cat /opt/config/vsn_private_ip_1.txt)
21 echo "auto eth2" >> /etc/network/interfaces
22 echo "iface eth2 inet static" >> /etc/network/interfaces
23 echo " address $VSN_PRIVATE_IP_1" >> /etc/network/interfaces
24 echo " netmask 255.255.255.0" >> /etc/network/interfaces
25 echo " mtu $MTU" >> /etc/network/interfaces
31 # Download required dependencies
32 add-apt-repository -y ppa:openjdk-r/ppa
34 apt-get install -y make wget openjdk-8-jdk apt-transport-https ca-certificates darkstat
36 # Configure and run Darkstat
37 sed -i "s/START_DARKSTAT=.*/START_DARKSTAT=yes/g" /etc/darkstat/init.cfg
38 sed -i "s/INTERFACE=.*/INTERFACE=\"-i eth1\"/g" /etc/darkstat/init.cfg
39 /etc/init.d/darkstat start
41 # Download scripts for virtual sink
43 wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vfw/$INSTALL_SCRIPT_VERSION/v_sink_init.sh
44 wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vfw/$INSTALL_SCRIPT_VERSION/vsink.sh
45 chmod +x v_sink_init.sh
48 # Run instantiation script
49 mv vsink.sh /etc/init.d
50 update-rc.d vsink.sh defaults