summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/snmp/vyatta-snmp.pl6
-rwxr-xr-xscripts/system/vyatta_update_resolv.pl257
-rwxr-xr-xscripts/vyatta-address76
-rw-r--r--scripts/vyatta-encapsulation11
-rwxr-xr-xscripts/vyatta-system-nameservers107
-rwxr-xr-xscripts/vyatta-tunnel-cleanup3
6 files changed, 226 insertions, 234 deletions
diff --git a/scripts/snmp/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl
index a39b517b..6423db15 100755
--- a/scripts/snmp/vyatta-snmp.pl
+++ b/scripts/snmp/vyatta-snmp.pl
@@ -224,17 +224,17 @@ sub snmp_get_values {
$config->setLevel($snmp_level);
my $contact = $config->returnValue("contact");
if (defined $contact) {
- print "syscontact \"$contact\" \n";
+ print "SysContact $contact \n";
}
my $description = $config->returnValue("description");
if (defined $description) {
- print "sysdescr \"$description\" \n";
+ print "SysDescr $description \n";
}
my $location = $config->returnValue("location");
if (defined $location) {
- print "syslocation \"$location\" \n";
+ print "SysLocation $location \n";
}
}
diff --git a/scripts/system/vyatta_update_resolv.pl b/scripts/system/vyatta_update_resolv.pl
index b311bff5..921052f0 100755
--- a/scripts/system/vyatta_update_resolv.pl
+++ b/scripts/system/vyatta_update_resolv.pl
@@ -25,34 +25,43 @@
use strict;
use lib "/opt/vyatta/share/perl5/";
-
-
use Getopt::Long;
+use Vyatta::Config;
+
my $dhclient_script = 0;
-GetOptions("dhclient-script=i" => \$dhclient_script);
+my $config_mode = 0;
+GetOptions("dhclient-script=i" => \$dhclient_script,
+ "config-mode=i" => \$config_mode,
+);
-use Vyatta::Config;
my $vc = new Vyatta::Config();
-
$vc->setLevel('system');
+
my @domains;
my $domain_name = undef;
+my $disable_dhcp_nameservers = undef;
+
+if ($config_mode == 1) {
+ $disable_dhcp_nameservers = $vc->exists('disable-dhcp-nameservers');
+} else {
+ $disable_dhcp_nameservers = $vc->existsOrig('disable-dhcp-nameservers');
+}
if ($dhclient_script == 1) {
- @domains = $vc->returnOrigValues('domain-search domain');
- $domain_name = $vc->returnOrigValue('domain-name');
+ @domains = $vc->returnOrigValues('domain-search domain');
+ $domain_name = $vc->returnOrigValue('domain-name');
} else {
- @domains = $vc->returnValues('domain-search domain');
- $domain_name = $vc->returnValue('domain-name');
+ @domains = $vc->returnValues('domain-search domain');
+ $domain_name = $vc->returnValue('domain-name');
}
if ($dhclient_script == 0 && @domains > 0 && $domain_name && length($domain_name) > 0) {
my @loc;
if ($vc->returnOrigValues('domain-search domain') > 0) {
- @loc = ["system","domain-name"];
+ @loc = ["system","domain-name"];
}
else {
- @loc = ["system","domain-search","domain"];
+ @loc = ["system","domain-search","domain"];
}
Vyatta::Config::outputError(@loc,"System configuration error. Both \'domain-name\' and \'domain-search\' are specified, but only one of these mutually exclusive parameters is allowed.");
exit(1);
@@ -60,126 +69,129 @@ if ($dhclient_script == 0 && @domains > 0 && $domain_name && length($domain_name
my $doms = '';
foreach my $domain (@domains) {
- if (length($doms) > 0) {
- $doms .= ' ';
- }
- $doms .= $domain;
+ if (length($doms) > 0) {
+ $doms .= ' ';
+ }
+ $doms .= $domain;
}
# add domain names received from dhcp client to domain search in /etc/resolv.conf if domain-name not set in CLI
+
if (!defined($domain_name)) {
- my @dhcp_interfaces_resolv_files = `ls /etc/ | grep resolv.conf.dhclient-new`;
- if ($#dhcp_interfaces_resolv_files >= 0) {
- for my $each_file (@dhcp_interfaces_resolv_files) {
- chomp $each_file;
- my $find_search = `grep "^search" /etc/$each_file 2> /dev/null | wc -l`;
- if ($find_search == 1) {
- my $search_string = `grep "^search" /etc/$each_file`;
- my @dhcp_domains = split(/\s+/, $search_string, 2);
- my $dhcp_domain = $dhcp_domains[1];
- chomp $dhcp_domain;
- $doms .= ' ' . $dhcp_domain;
- }
+ my @dhcp_interfaces_resolv_files = `ls /etc/ | grep resolv.conf.dhclient-new`;
+ if ($#dhcp_interfaces_resolv_files >= 0) {
+ for my $each_file (@dhcp_interfaces_resolv_files) {
+ chomp $each_file;
+ my $find_search = `grep "^search" /etc/$each_file 2> /dev/null | wc -l`;
+ if ($find_search == 1) {
+ my $search_string = `grep "^search" /etc/$each_file`;
+ my @dhcp_domains = split(/\s+/, $search_string, 2);
+ my $dhcp_domain = $dhcp_domains[1];
+ chomp $dhcp_domain;
+ $doms .= ' ' . $dhcp_domain;
+ }
+ }
}
- }
}
my $search = '';
if (length($doms) > 0) {
- $search = "search\t\t$doms\t\t#line generated by $0\n";
+ $search = "search\t\t$doms\t\t#line generated by $0\n";
}
my $domain = '';
if ($domain_name && length($domain_name) > 0) {
- $domain = "domain\t\t$domain_name\t\t#line generated by $0\n";
+ $domain = "domain\t\t$domain_name\t\t#line generated by $0\n";
}
-# update /etc/resolv.conf for name-servers received from dhcp client, only done when dhclient-script calls this script
-if ($dhclient_script == 1) {
- my @current_dhcp_nameservers;
- my $restart_ntp = 0;
-
- # code below to add new name-servers received from dhcp client
-
- my @dhcp_interfaces_resolv_files = `ls /etc/ | grep resolv.conf.dhclient-new`;
- if ($#dhcp_interfaces_resolv_files >= 0) {
- my $ns_count = 0;
- for my $each_file (@dhcp_interfaces_resolv_files) {
- chomp $each_file;
- my $find_nameserver = `grep nameserver /etc/$each_file 2> /dev/null | wc -l`;
- if ($find_nameserver > 0) {
- my @nameservers = `grep nameserver /etc/$each_file`;
- for my $each_nameserver (@nameservers) {
- my @nameserver = split(/ /, $each_nameserver, 2);
- my $ns = $nameserver[1];
- chomp $ns;
- $current_dhcp_nameservers[$ns_count] = $ns;
- $ns_count++;
- my @search_ns_in_resolvconf = `grep $ns /etc/resolv.conf`;
- my $ns_in_resolvconf = 0;
- if (@search_ns_in_resolvconf > 0) {
- foreach my $ns_resolvconf (@search_ns_in_resolvconf) {
- my @resolv_ns = split(/\s+/, $ns_resolvconf);
- my $final_ns = $resolv_ns[1];
- chomp $final_ns;
- if ($final_ns eq $ns) {
- $ns_in_resolvconf = 1;
- }
- }
- }
- if ($ns_in_resolvconf == 0) {
- open (my $rf, '>>', '/etc/resolv.conf')
- or die "$! error trying to overwrite";
- print $rf "#nameserver\t$ns\t\t#nameserver written by $0\n";
- print $rf "nameserver\t$ns\n";
- close $rf;
- $restart_ntp = 1;
- }
+# update /etc/resolv.conf with name-servers received from dhcp client, done when this script is called
+# with either the dhclient-script (on DHCP changes) or config-mode (disable-dhcp-nameservers) options.
+
+if (($dhclient_script == 1) || ($config_mode == 1)) {
+ my @current_dhcp_nameservers;
+ my $restart_ntp = 0;
+
+ # code below to add new name-servers received from dhcp client, but only if disable-dhcp-nameservers
+ # hasn't been enabled.
+
+ my @dhcp_interfaces_resolv_files = `ls /etc/ | grep resolv.conf.dhclient-new`;
+ if ($#dhcp_interfaces_resolv_files >= 0) {
+ my $ns_count = 0;
+ for my $each_file (@dhcp_interfaces_resolv_files) {
+ chomp $each_file;
+ my $find_nameserver = `grep nameserver /etc/$each_file 2> /dev/null | wc -l`;
+ if ($find_nameserver > 0) {
+ my @nameservers = `grep nameserver /etc/$each_file`;
+ for my $each_nameserver (@nameservers) {
+ my @nameserver = split(/ /, $each_nameserver, 2);
+ my $ns = $nameserver[1];
+ chomp $ns;
+ $current_dhcp_nameservers[$ns_count] = $ns;
+ $ns_count++;
+ my @search_ns_in_resolvconf = `grep $ns /etc/resolv.conf`;
+ my $ns_in_resolvconf = 0;
+ if (@search_ns_in_resolvconf > 0) {
+ foreach my $ns_resolvconf (@search_ns_in_resolvconf) {
+ my @resolv_ns = split(/\s+/, $ns_resolvconf);
+ my $final_ns = $resolv_ns[1];
+ chomp $final_ns;
+ if ($final_ns eq $ns) {
+ $ns_in_resolvconf = 1;
+ }
+ }
+ }
+ if (($ns_in_resolvconf == 0) && !($disable_dhcp_nameservers)) {
+ open (my $rf, '>>', '/etc/resolv.conf')
+ or die "$! error trying to overwrite";
+ print $rf "nameserver\t$ns\t\t#nameserver written by $0\n";
+ close $rf;
+ $restart_ntp = 1;
+ }
+ }
}
- }
+ }
}
- }
-
- # code below to remove old name-servers from /etc/resolv.conf that were not received in this response from dhcp-server
-
- my @nameservers_dhcp_in_resolvconf = `grep 'nameserver written' /etc/resolv.conf`;
- my @dhcp_nameservers_in_resolvconf;
- my $count_nameservers_in_resolvconf = 0;
- for my $count_dhcp_nameserver (@nameservers_dhcp_in_resolvconf) {
- my @dhcp_nameserver = split(/\t/, $count_dhcp_nameserver, 3);
- $dhcp_nameservers_in_resolvconf[$count_nameservers_in_resolvconf] = $dhcp_nameserver[1];
- $count_nameservers_in_resolvconf++;
- }
- if ($#current_dhcp_nameservers < 0) {
- for my $dhcpnameserver (@dhcp_nameservers_in_resolvconf) {
- my $cmd = "sed -i '/$dhcpnameserver\t/d' /etc/resolv.conf";
- system($cmd);
- $restart_ntp = 1;
+
+ # code below to remove old name-servers from /etc/resolv.conf that were not received in this response
+ # from dhcp-server, or to remove previous dhcp supplied name-servers if disable-dhcp-nameservers has
+ # been enabled.
+
+ my @nameservers_dhcp_in_resolvconf = `grep 'nameserver written' /etc/resolv.conf`;
+ my @dhcp_nameservers_in_resolvconf;
+ my $count_nameservers_in_resolvconf = 0;
+ for my $count_dhcp_nameserver (@nameservers_dhcp_in_resolvconf) {
+ my @dhcp_nameserver = split(/\t/, $count_dhcp_nameserver, 3);
+ $dhcp_nameservers_in_resolvconf[$count_nameservers_in_resolvconf] = $dhcp_nameserver[1];
+ $count_nameservers_in_resolvconf++;
}
- } else {
- for my $dhcpnameserver (@dhcp_nameservers_in_resolvconf) {
+ if (($#current_dhcp_nameservers < 0) || ($disable_dhcp_nameservers)) {
+ for my $dhcpnameserver (@dhcp_nameservers_in_resolvconf) {
+ my $cmd = "sed -i '/$dhcpnameserver\t/d' /etc/resolv.conf";
+ system($cmd);
+ $restart_ntp = 1;
+ }
+ } else {
+ for my $dhcpnameserver (@dhcp_nameservers_in_resolvconf) {
my $found = 0;
for my $currentnameserver (@current_dhcp_nameservers) {
- if ($dhcpnameserver eq $currentnameserver){
- $found = 1;
- }
+ if ($dhcpnameserver eq $currentnameserver){
+ $found = 1;
+ }
}
if ($found == 0) {
- my $cmd = "sed -i '/$dhcpnameserver\t/d' /etc/resolv.conf";
- system($cmd);
- $restart_ntp = 1;
+ my $cmd = "sed -i '/$dhcpnameserver\t/d' /etc/resolv.conf";
+ system($cmd);
+ $restart_ntp = 1;
}
-
}
- }
- if ($restart_ntp == 1) {
- # this corresponds to what is done in name-server/node.def as a fix for bug 1300
- my $cmd_ntp_restart = "if [ -f /etc/ntp.conf ] && grep -q '^server' /etc/ntp.conf; then /usr/sbin/invoke-rc.d ntp restart >&/dev/null; fi &";
- system($cmd_ntp_restart);
- }
+ }
+ if ($restart_ntp == 1) {
+ # this corresponds to what is done in name-server/node.def as a fix for bug 1300
+ my $cmd_ntp_restart = "if [ -f /etc/ntp.conf ] && grep -q '^server' /etc/ntp.conf; then /usr/sbin/invoke-rc.d ntp restart >&/dev/null; fi &";
+ system($cmd_ntp_restart);
+ }
}
-
# The following will re-write '/etc/resolv.conf' line by line,
# replacing the 'search' specifier with the latest values,
# or replacing the 'domain' specifier with the latest value.
@@ -187,12 +199,11 @@ if ($dhclient_script == 1) {
my @resolv;
if (-e '/etc/resolv.conf') {
open (my $f, '<', '/etc/resolv.conf')
- or die("$0: Error! Unable to open '/etc/resolv.conf' for input: $!\n");
+ or die("$0: Error! Unable to open '/etc/resolv.conf' for input: $!\n");
@resolv = <$f>;
close ($f);
}
-
my $foundSearch = 0;
my $foundDomain = 0;
@@ -200,26 +211,26 @@ open (my $r, '>', '/etc/resolv.conf')
or die("$0: Error! Unable to open '/etc/resolv.conf' for output: $!\n");
foreach my $line (@resolv) {
- if ($line =~ /^search\s/) {
- $foundSearch = 1;
- if (length($search) > 0) {
- print $r $search;
- }
- } elsif ($line =~ /^domain\s/) {
- $foundDomain = 1;
- if (length($domain) > 0) {
- print $r $domain;
- }
- } else {
- print $r $line;
- }
+ if ($line =~ /^search\s/) {
+ $foundSearch = 1;
+ if (length($search) > 0) {
+ print $r $search;
+ }
+ } elsif ($line =~ /^domain\s/) {
+ $foundDomain = 1;
+ if (length($domain) > 0) {
+ print $r $domain;
+ }
+ } else {
+ print $r $line;
+ }
}
+
if ($foundSearch == 0 && length($search) > 0) {
- print $r $search;
+ print $r $search;
}
if ($foundDomain == 0 && length($domain) > 0) {
- print $r $domain;
+ print $r $domain;
}
close ($r);
-
diff --git a/scripts/vyatta-address b/scripts/vyatta-address
index 08e14196..3cc1755b 100755
--- a/scripts/vyatta-address
+++ b/scripts/vyatta-address
@@ -9,45 +9,49 @@ if [ $# -ne 3 ]; then
fi
case $1 in
- add)
- if [[ "$3" = "dhcp" ]]
- then
- exec /opt/vyatta/sbin/vyatta-interfaces.pl --dev="$2" --dhcp=start
- elif [[ "$3" = "dhcpv6" ]]
- then
+ add)
+ if [[ "$3" = "dhcp" ]]; then
+ exec /opt/vyatta/sbin/vyatta-interfaces.pl --dev="$2" --dhcp=start
+ elif [[ "$3" = "dhcpv6" ]]; then
exec /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --start -ifname "$2"
- elif [[ "$3" =~ ":" ]]
- then # Ipv6 address
- if ! ip -6 addr list dev $2 | grep -q $3; then
- exec ip -6 addr add "$3" dev "$2"
- fi
- else
- if ! ip addr list dev $2 | grep -q $3; then
- exec ip addr add "$3" broadcast + dev "$2"
- fi
- fi ;;
+ elif [[ "$3" =~ ":" ]]; then
+ # Ipv6 address
+ if ! ip -6 addr list dev $2 | grep -q $3; then
+ exec ip -6 addr add "$3" dev "$2"
+ fi
+ else
+ if ! ip addr list dev $2 | grep -q $3; then
+ exec ip addr add "$3" broadcast + dev "$2"
+ fi
+ fi ;;
- delete)
- if ! /sbin/ip address show dev $2 2>/dev/null | grep -q "$3"; then
+ delete)
+ # Get current address from interface when using DHCP
+ if [[ "$3" = "dhcp" ]]; then
+ file=/var/lib/dhcp3/dhclient_"$2"_lease;
+ ip_address=$(sed -n "/new_ip_address='/ s/.*\='*//p" $file | sed -n "s/'//p");
+ else
+ ip_address=$3;
+ fi
+
+ if ! /sbin/ip address show dev $2 2>/dev/null | grep -q "$ip_address"; then
# Address doesn't exist there, nothing to delete
exit 0
fi
- if [ ! -d "/sys/class/net/$2" ]
- then # device is already gone
- exit 0
- elif [[ "$3" = "dhcp" ]]
- then
- exec /opt/vyatta/sbin/vyatta-interfaces.pl --dev="$2" --dhcp=stop
- elif [[ "$3" = "dhcpv6" ]]
- then
- exec /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --stop --ifname "$2"
- elif [[ "$3" =~ ":" ]]
- then
- exec ip -6 addr del "$3" dev "$2"
- else
- exec ip addr del "$3" dev "$2"
- fi ;;
- *)
- echo "Unknown option $1"
- exit 1 ;;
+
+ if [ ! -d "/sys/class/net/$2" ]; then
+ # device is already gone
+ exit 0
+ elif [[ "$3" = "dhcp" ]]; then
+ exec /opt/vyatta/sbin/vyatta-interfaces.pl --dev="$2" --dhcp=stop
+ elif [[ "$3" = "dhcpv6" ]]; then
+ exec /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --stop --ifname "$2"
+ elif [[ "$3" =~ ":" ]]; then
+ exec ip -6 addr del "$3" dev "$2"
+ else
+ exec ip addr del "$3" dev "$2"
+ fi ;;
+ *)
+ echo "Unknown option $1"
+ exit 1 ;;
esac
diff --git a/scripts/vyatta-encapsulation b/scripts/vyatta-encapsulation
deleted file mode 100644
index f1cae8b1..00000000
--- a/scripts/vyatta-encapsulation
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-list="gre gre-bridge gre-multipoint ipip sit ipip6 ip6ip6"
-full_list="${list}"
-if [[ -n "$1" ]]; then
- for f in ${full_list}; do if [[ "$1" = "$f" ]]; then exit 0; fi; done
- echo "Must be (${full_list})"
- exit 1;
-else
- echo ${full_list}
-fi
diff --git a/scripts/vyatta-system-nameservers b/scripts/vyatta-system-nameservers
index 1df0f02c..74f2c8b6 100755
--- a/scripts/vyatta-system-nameservers
+++ b/scripts/vyatta-system-nameservers
@@ -23,71 +23,64 @@
# **** End License ****
#
-print_usage()
-{
+print_usage() {
echo "Usage:"
echo -e "\t$0 update <ip of name-server>"
echo -e "\t$0 delete <ip of name-server>"
}
-restart_dnsmasq ()
-{
- # restart dnsmasq if dns-forwarding is configured
- if cli-shell-api existsActive service dns forwarding; then
- /opt/vyatta/sbin/vyatta-dns-forwarding.pl --update-dnsforwarding >&/dev/null
- fi
+restart_dnsmasq () {
+ # restart dnsmasq if dns-forwarding is configured
+ if cli-shell-api existsActive service dns forwarding; then
+ /opt/vyatta/sbin/vyatta-dns-forwarding.pl --update-dnsforwarding >&/dev/null
+ fi
}
-restart_ntp ()
-{
- # restart ntp if ntp is configured
- if [ -f /etc/ntp.conf ] && grep -q "^server" /etc/ntp.conf; then
- /usr/sbin/invoke-rc.d ntp restart >&/dev/null
- fi
+restart_ntp () {
+ # restart ntp if ntp is configured
+ if [ -f /etc/ntp.conf ] && grep -q "^server" /etc/ntp.conf; then
+ /usr/sbin/invoke-rc.d ntp restart >&/dev/null
+ fi
}
-
-update_system_nameservers ()
-{
- nameserver=$1
- touch /etc/resolv.conf
- # if name-server already in /etc/resolv.conf then exit
- if grep -q "$nameserver\($\|[[:space:]]\)" /etc/resolv.conf; then
- exit 0
- else
- # find last instance of cli inserted nameserver
- # insert currently received nameserver immediately after that
- # this is done to keep system set nameservers priority over dhcp received nameservers
- cli_ns_array=($(awk '{if (!$3) print $2}' /etc/resolv.conf))
- cli_ns_array_len=${#cli_ns_array[*]}
- line_num=0
- if [ $cli_ns_array_len -gt 0 ]; then
- grepped_ns_line=`grep "${cli_ns_array[$cli_ns_array_len-1]}$" -n /etc/resolv.conf`
- echo ${grepped_ns_line%%:*} > /etc/resolv_tmp.conf
- line_num=`cat /etc/resolv_tmp.conf`
- fi
- head -$line_num /etc/resolv.conf > /etc/resolv_tmp.conf
- echo "nameserver $nameserver" >> /etc/resolv_tmp.conf
- total_lines=`cat /etc/resolv.conf | wc -l`
- rest_lines=`expr $total_lines - $line_num`
- tail -$rest_lines /etc/resolv.conf >> /etc/resolv_tmp.conf
- mv -f /etc/resolv_tmp.conf /etc/resolv.conf
- fi
- restart_dnsmasq
- restart_ntp
+update_system_nameservers () {
+ nameserver=$1
+ touch /etc/resolv.conf
+ # if name-server already in /etc/resolv.conf then exit
+ if grep -q "$nameserver\($\|[[:space:]]\)" /etc/resolv.conf; then
+ exit 0
+ else
+ # find last instance of cli inserted nameserver
+ # insert currently received nameserver immediately after that
+ # this is done to keep system set nameservers priority over dhcp received nameservers
+ cli_ns_array=($(awk '{if (!$3) print $2}' /etc/resolv.conf))
+ cli_ns_array_len=${#cli_ns_array[*]}
+ line_num=0
+ if [ $cli_ns_array_len -gt 0 ]; then
+ grepped_ns_line=`grep "${cli_ns_array[$cli_ns_array_len-1]}$" -n /etc/resolv.conf`
+ echo ${grepped_ns_line%%:*} > /etc/resolv_tmp.conf
+ line_num=`cat /etc/resolv_tmp.conf`
+ fi
+ head -$line_num /etc/resolv.conf > /etc/resolv_tmp.conf
+ echo "nameserver $nameserver" >> /etc/resolv_tmp.conf
+ total_lines=`cat /etc/resolv.conf | wc -l`
+ rest_lines=`expr $total_lines - $line_num`
+ tail -$rest_lines /etc/resolv.conf >> /etc/resolv_tmp.conf
+ mv -f /etc/resolv_tmp.conf /etc/resolv.conf
+ fi
+ restart_dnsmasq
+ restart_ntp
}
-delete_system_nameserver ()
-{
- nameserver=$1
- touch /etc/resolv.conf
- # remove specified nameserver
- sed -i "/$nameserver$/d" /etc/resolv.conf
- restart_dnsmasq
- restart_ntp
+delete_system_nameserver () {
+ nameserver=$1
+ touch /etc/resolv.conf
+ # remove specified nameserver
+ sed -i "/$nameserver$/d" /etc/resolv.conf
+ restart_dnsmasq
+ restart_ntp
}
-
#
# main
#
@@ -95,8 +88,8 @@ delete_system_nameserver ()
case "$1" in
update)
if [ $# -ne 2 ]; then
- print_usage
- exit 1
+ print_usage
+ exit 1
fi
update_system_nameservers $2
exit 0
@@ -104,17 +97,15 @@ case "$1" in
delete)
if [ $# -ne 2 ]; then
- print_usage
- exit 1
+ print_usage
+ exit 1
fi
delete_system_nameserver $2
exit 0
;;
-
*)
print_usage
exit 1
;;
-
esac
diff --git a/scripts/vyatta-tunnel-cleanup b/scripts/vyatta-tunnel-cleanup
index af73bc04..979fb7bd 100755
--- a/scripts/vyatta-tunnel-cleanup
+++ b/scripts/vyatta-tunnel-cleanup
@@ -26,9 +26,6 @@ my %tunnel;
foreach my $tun ( $config->listEffectiveNodes() ) {
my $mode = $config->returnEffectiveValue("$tun encapsulation");
next if ($interface eq $tun); # don't count the one being deleted
- if ($mode eq "gre-multipoint") {
- $mode = "gre";
- }
$tunnel{$mode} = 1;
}