diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-05-12 12:38:23 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-05-12 12:38:23 +0000 |
commit | 2f8375b74f79a7926c310daaaeef4d3c6068e014 (patch) | |
tree | 9a887a150ba96449001edbca76e3c829fe2510db | |
parent | afa9c4395c7aff570b871ae1a360e299a6e05d59 (diff) | |
download | drakx-net-distro/mdv2008.0.tar drakx-net-distro/mdv2008.0.tar.gz drakx-net-distro/mdv2008.0.tar.bz2 drakx-net-distro/mdv2008.0.tar.xz drakx-net-distro/mdv2008.0.zip |
allow to skip protocol and address configuration (defaulting to dhcp) if AUTOMATIC_ADDRESS is true in /etc/sysconfig/drakx-netdistro/mdv2008.0
-rw-r--r-- | lib/network/connection/ethernet.pm | 6 | ||||
-rw-r--r-- | lib/network/connection_manager.pm | 4 | ||||
-rw-r--r-- | lib/network/netconnect.pm | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/network/connection/ethernet.pm b/lib/network/connection/ethernet.pm index 29c6be9..2815f1c 100644 --- a/lib/network/connection/ethernet.pm +++ b/lib/network/connection/ethernet.pm @@ -57,8 +57,10 @@ sub check_device { } sub get_protocols() { - { - static => N("Manual configuration"), + my $system_file = '/etc/sysconfig/drakx-net'; + my %global_settings = getVarsFromSh($system_file); + +{ + if_(!text2bool($global_settings{AUTOMATIC_ADDRESS}), static => N("Manual configuration")), dhcp => N("Automatic IP (BOOTP/DHCP)"), }; } diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm index 53a0312..02037c1 100644 --- a/lib/network/connection_manager.pm +++ b/lib/network/connection_manager.pm @@ -110,6 +110,8 @@ sub configure_connection { } load_settings($cmanager); + my $system_file = '/etc/sysconfig/drakx-net'; + my %global_settings = getVarsFromSh($system_file); my $error; do { @@ -132,7 +134,7 @@ sub configure_connection { { label => $cmanager->{connection}->get_access_settings_label, title => 1, advanced => 1 }, @{$cmanager->{connection}->get_access_settings} ) : (), - $cmanager->{connection}->can('get_address_settings') ? ( + $cmanager->{connection}->can('get_address_settings') && !text2bool($global_settings{AUTOMATIC_ADDRESS}) ? ( { label => $cmanager->{connection}->get_address_settings_label, title => 1, advanced => 1 }, @{$cmanager->{connection}->get_address_settings('show_all')} ) : (), diff --git a/lib/network/netconnect.pm b/lib/network/netconnect.pm index 92c0ca1..a0fae70 100644 --- a/lib/network/netconnect.pm +++ b/lib/network/netconnect.pm @@ -100,7 +100,7 @@ sub real_main { "select_protocol" => sub { $connection->can('get_protocols') }, #- peer settings may depend on provider and protocol (VPI/VCI for xDSL) "configure_access" => sub { $connection->can('get_access_settings') }, - "configure_address" => sub { $connection->can('get_address_settings') || $connection->can('get_hostname_settings') }, + "configure_address" => sub { ($connection->can('get_address_settings') || $connection->can('get_hostname_settings')) && !text2bool($global_settings{AUTOMATIC_ADDRESS}) }, "configure_control" => sub { $connection->can('get_control_settings') }, "apply_connection" => sub { 1 }, ); |