Initial OpenECOMP Demo commit
[demo.git] / vnfs / vLB / scripts / remove_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_ID"/32" $DNS_IPADDR del
14 vppctl create gre tunnel src $MY_PRIVATE_IP dst $DNS_IPADDR del
15
16 # Update the number of vDNSs currently active
17 FD="/opt/VES/code/evel_training/VESreporting/active_dns.txt"
18 CURR_DNS=$(cat $FD)
19 let CURR_DNS=$CURR_DNS-1
20 if [[ $CURR_DNS -lt 0 ]]
21 then 
22   CURR_DNS=0
23 fi
24 echo $CURR_DNS > $FD