diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-05-26 11:55:07 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-05-26 11:55:07 +0000 |
commit | 8670ee25f1eada3966273e1c8fa0fa287f3d8139 (patch) | |
tree | df099b06d7355daa5307609b084449ece99aecb2 /perl-install/standalone | |
parent | c6fbb62abb5a8a9a4aafc5ac343d84b0ea8efcec (diff) | |
download | drakx-8670ee25f1eada3966273e1c8fa0fa287f3d8139.tar drakx-8670ee25f1eada3966273e1c8fa0fa287f3d8139.tar.gz drakx-8670ee25f1eada3966273e1c8fa0fa287f3d8139.tar.bz2 drakx-8670ee25f1eada3966273e1c8fa0fa287f3d8139.tar.xz drakx-8670ee25f1eada3966273e1c8fa0fa287f3d8139.zip |
add "choose_net_interface" step to have a real wizard step when asking
net interface
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/drakgw | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/perl-install/standalone/drakgw b/perl-install/standalone/drakgw index 4a74914b2..8239d18bf 100755 --- a/perl-install/standalone/drakgw +++ b/perl-install/standalone/drakgw @@ -62,7 +62,7 @@ my %eth_intf = map { $_->[0] => join(': ', $_->[0], $_->[2]) } network::ethernet my $shorewall = network::shorewall::read(); my $choice; my $gw_enabled; -my ($lan_interface_name, $lan_intf, $internal_domain_name); +my ($net_interface_name, $lan_interface_name, $lan_intf, $internal_domain_name); my $use_dhcpd = 1; my $use_caching_dns = 1; my $use_caching_proxy = 1; @@ -87,11 +87,11 @@ Make sure you have configured your Network/Internet access using drakconnect bef Note: you need a dedicated Network Adapter to set up a Local Area Network (LAN)."), post => sub { $gw_enabled = !$shorewall->{disabled} && grep { !/^#/ } cat_($masq_file); - return $gw_enabled ? "reconfigure" : lan_interface_step(); + return $gw_enabled ? "ask_reconfigure" : "choose_net_interface"; }, }, - reconfigure => + ask_reconfigure => { name => sub { $gw_enabled ? @@ -116,7 +116,28 @@ What would you like to do?"); #- FIXME : not used for now gw_disable(); return "end_disabled"; } elsif ($choice eq "Reconfigure") { - return lan_interface_step(); + return "choose_net_interface"; + } + }, + }, + + choose_net_interface => + { + pre => sub { + $net_interface_name = $shorewall->{net_interface}; + }, + name => translate($network::shorewall::ask_shorewall_interface_label), + data => network::shorewall::shorewall_interface_choices(\$net_interface_name), + post => sub { + network::shorewall::set_net_interface($shorewall, $net_interface_name); + my $locals = @{$shorewall->{loc_interface}}; + if ($locals == 0) { + return "end_no_lan_interface"; + } elsif ($locals == 1) { + $lan_interface_name = $shorewall->{loc_interface}[0]; + return "one_lan_interface"; + } else { + return "choose_lan_interface"; } }, }, @@ -336,19 +357,6 @@ sub format_interfaces { $eth_intf{$interface} || $interface; } -sub lan_interface_step() { - network::shorewall::read_default_interfaces($shorewall, $in); - my $locals = @{$shorewall->{loc_interface}}; - if ($locals == 0) { - return "end_no_lan_interface"; - } elsif ($locals == 1) { - $lan_interface_name = $shorewall->{loc_interface}[0]; - return "one_lan_interface"; - } else { - return "choose_lan_interface"; - } -} - sub end_step() { gw_configure(); log::l("[drakgw] Installation complete, exiting"); |