summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-27 10:19:00 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-27 10:19:00 -0700
commit569863924b754c82508d6791d0ae2255e67f2f7e (patch)
tree66109802653d95595420fc4dd7e7e617b4568699
parent80966545a12ee4e0de56874abbd2c86a0943cd1b (diff)
parent5d201ef68e88c501fa98acef9c5e414415b74ffe (diff)
downloadvyatta-cfg-569863924b754c82508d6791d0ae2255e67f2f7e.tar.gz
vyatta-cfg-569863924b754c82508d6791d0ae2255e67f2f7e.zip
Merge branch 'jenner' of suva.vyatta.com:/git/vyatta-cfg into jenner
-rwxr-xr-xscripts/vyatta-interfaces.pl24
1 files changed, 14 insertions, 10 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl
index de5fa49..9edf8f2 100755
--- a/scripts/vyatta-interfaces.pl
+++ b/scripts/vyatta-interfaces.pl
@@ -46,7 +46,7 @@ use warnings;
my $dhcp_daemon = '/sbin/dhclient';
my ($eth_update, $eth_delete, $addr, $dev, $mac, $mac_update, $op_dhclient);
-my ($check_name, $show_names, $intf_cli_path, $vif_name, $warn_name, $show_mtu);
+my ($check_name, $show_names, $intf_cli_path, $vif_name, $warn_name, $show_path);
sub usage {
print "Usage: $0 --dev=<interface> --check=<type>\n";
@@ -55,7 +55,7 @@ sub usage {
print " $0 --dev=<interface> --eth-addr-update=<aa:aa:aa:aa:aa:aa>\n";
print " $0 --dev=<interface> --eth-addr-delete=<aa:aa:aa:aa:aa:aa>\n";
print " $0 --dev=<interface> --valid-addr={<a.b.c.d>|dhcp}\n";
- print " $0 --dev=<interface> --mtu\n";
+ print " $0 --dev=<interface> --path\n";
print " $0 --show=<type>\n";
exit 1;
}
@@ -71,7 +71,7 @@ GetOptions("eth-addr-update=s" => \$eth_update,
"show=s" => \$show_names,
"vif=s" => \$vif_name,
"warn" => \$warn_name,
- "mtu" => \$show_mtu,
+ "path" => \$show_path,
) or usage();
update_eth_addrs($eth_update, $dev) if ($eth_update);
@@ -83,7 +83,7 @@ op_dhcp_command($op_dhclient, $dev) if ($op_dhclient);
is_valid_name($check_name, $dev) if ($check_name);
exists_name($dev) if ($warn_name);
show_interfaces($show_names) if ($show_names);
-show_mtu($dev) if ($show_mtu);
+show_config_level($dev) if ($show_path);
exit 0;
sub is_ip_configured {
@@ -155,12 +155,6 @@ sub get_mtu {
return $intf->mtu();
}
-sub show_mtu {
- my $name = shift;
- my $mtu = get_mtu($name);
- print "$mtu\n" if $mtu;
-}
-
sub dhcp_update_config {
my ($conf_file, $intf) = @_;
@@ -485,3 +479,13 @@ sub show_interfaces {
}
print join(' ', @match), "\n";
}
+
+sub show_config_level {
+ my $name = shift;
+ my $intf = new Vyatta::Interface($name);
+ die "$name does not match any known interface name type\n"
+ unless $intf;
+
+ print $intf->path(), "\n";
+}
+