Initial OpenECOMP Demo commit
[demo.git] / vnfs / vLB / scripts / add_dns.sh
1 #!/bin/bash
2
3 if [ ! "$#" -eq 1 ]
4 then
5   echo "Usage: ./add_dns.sh [remote DNS server]"
6   exit
7 fi
8
9 DNS_IPADDR=$1
10 MY_PUBLIC_IP=$(cat /opt/config/local_public_ipaddr.txt)
11 MY_PRIVATE_IP=$(cat /opt/config/local_private_ipaddr.txt)
12
13 vppctl lb as $MY_PUBLIC_IP"/32" $DNS_IPADDR
14 GRE=$(vppctl create gre tunnel src $MY_PRIVATE_IP dst $DNS_IPADDR)
15 vppctl set int state $GRE up
16
17 # Update the number of vDNSs currently active
18 FD="/opt/VES/code/evel_training/VESreporting/active_dns.txt"
19 CURR_DNS=$(cat $FD)
20 let CURR_DNS=$CURR_DNS+1
21 echo $CURR_DNS > $FD