From 8fb993e064a06b3958a498a588e37500937af881 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 27 Aug 2004 11:49:48 +0000 Subject: write metric in ifcfg files according to connection type --- perl-install/network/tools.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'perl-install/network/tools.pm') diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index a789df850..536870973 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -289,7 +289,17 @@ sub get_interface_type { my ($interface) = @_; $interface->{DEVICE} =~ /^(eth|ath|wlan)/ && "ethernet" || $interface->{DEVICE} =~ /^ippp/ && "isdn" || - $interface->{DEVICE} =~ /^ppp/ && (member($interface->{TYPE}, "xDSL", "ADSL") ? "adsl" : "modem"); + $interface->{DEVICE} =~ /^ppp/ && (member($interface->{TYPE}, "xDSL", "ADSL") ? "adsl" : "modem") || + "unknown"; +} + +sub get_default_metric { + my ($type) = @_; + my @known_types = ("ethernet_gigabit", "ethernet", "adsl", "isdn", "modem", "unknown"); + my $idx; + eval { $idx = find_index { $type eq $_ } @known_types }; + $idx = @known_types if $@; + $idx * 10; } 1; -- cgit v1.2.1