From 1354d01d74cf83c7260bb8dd4b1c07d484cf2c5d Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 14 Oct 2003 13:08:32 +0000 Subject: (default_interfaces) - simplify: ask_from already optimize the one item case for us - make it show up a pull-down menu rather than forcing one to type in the interface - fix it: $conf{net_interface} was *not* set on multiple interfaces case (read) fix it (conf was uselely initialized) --- perl-install/network/shorewall.pm | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'perl-install/network') diff --git a/perl-install/network/shorewall.pm b/perl-install/network/shorewall.pm index d6e88eb4e..bd069f063 100644 --- a/perl-install/network/shorewall.pm +++ b/perl-install/network/shorewall.pm @@ -66,9 +66,6 @@ sub default_interfaces { defined $card_netconnect and log::l("[drakgw] Information from netconnect: ignore card $card_netconnect"); my @l = detect_devices::getNet() or return; - if (@l == 1) { - $conf{net_interface} = $l[0]; - } else { $in->ask_from('', N("Please enter the name of the interface connected to the internet. @@ -77,26 +74,21 @@ Examples: eth0, or eth1 for cable connection, ippp+ for a isdn connection. ", $card_netconnect), - [ { label => N("Net Device"), val => \$card_netconnect, type => 'entry' } ]); - put_in_hash($conf ||= {}, { - net_interface => $card_netconnect, - }); + [ { label => N("Net Device"), val => \$card_netconnect, list => \@l } ]); $conf{net_interface} = $card_netconnect; #$conf{net_interface} = network::netconnect::get_net_device() || $l[0]; $conf{loc_interface} = [ grep { $_ ne $conf{net_interface} } @l ]; - } - \%conf; + \%conf; } sub read { my ($in, $mode) = @_; - my %conf = { disabled => !glob_("$::prefix/etc/rc3.d/S*shorewall") }; - - $conf{ports} = - join(' ', map { - my $e = $_; - map { "$_/$e->[3]" } split(',', $e->[4]); - } grep { $_->[0] eq 'ACCEPT' && $_->[1] eq 'net' } get_config_file('rules')); + my %conf = (disabled => !glob_("$::prefix/etc/rc3.d/S*shorewall"), + ports => join(' ', map { + my $e = $_; + map { "$_/$e->[3]" } split(',', $e->[4]); + } grep { $_->[0] eq 'ACCEPT' && $_->[1] eq 'net' } get_config_file('rules')) + ); if (my ($e) = get_config_file('masq')) { $conf{masquerade}{subnet} = $e->[1] if $e->[1]; -- cgit v1.2.1