summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/isdn.pm3
-rw-r--r--perl-install/network/netconnect.pm31
-rw-r--r--perl-install/network/network.pm3
3 files changed, 32 insertions, 5 deletions
diff --git a/perl-install/network/isdn.pm b/perl-install/network/isdn.pm
index 573ed6a8a..a42d54257 100644
--- a/perl-install/network/isdn.pm
+++ b/perl-install/network/isdn.pm
@@ -53,9 +53,6 @@ defaultroute
";
system "$::prefix/etc/rc.d/init.d/isdn4linux restart";
- # we start the virtual interface at boot (we dial only on demand.
- substInFile { s/^ONBOOT.*\n//; $_ .= qq(ONBOOT=yes\n) if eof } "$::prefix/etc/sysconfig/network-scripts/ifcfg-ippp$isdn->{intf_id}";
-
write_secret_backend($isdn->{login}, $isdn->{passwd});
set_cnx_script($netc, "isdn", join('',
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index 7dde76ea3..bdca6f0f7 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -84,7 +84,7 @@ sub real_main {
my ($modem, $modem_name, $modem_conf_read, $modem_dyn_dns, $modem_dyn_ip);
my ($adsl_type, @adsl_devices, $adsl_failed, $adsl_answer, %adsl_data, $adsl_data, $adsl_provider, $adsl_old_provider);
my ($ntf_name, $ipadr, $netadr, $gateway_ex, $up, $need_restart_network);
- my ($isdn, $isdn_name, $isdn_type, %isdn_cards);
+ my ($isdn, $isdn_name, $isdn_type, %isdn_cards, @isdn_dial_methods);
my $my_isdn = join('', N("Manual choice"), " (", N("Internal ISDN card"), ")");
my ($module, $auto_ip, $protocol, $onboot, $needhostname, $hotplug, $track_network_id, @fields); # lan config
my $success = 1;
@@ -199,6 +199,7 @@ sub real_main {
my $goto_start_on_boot_ifneeded = sub {
return $after_start_on_boot_step->() if $netcnx->{type} =~ /lan|cable/;
+ return "isdn_dial_on_boot" if $netcnx->{type} =~ /isdn/;
return "network_on_boot";
};
@@ -1174,6 +1175,34 @@ It is not necessary on most networks."),
},
},
+ isdn_dial_on_boot =>
+ {
+ pre => sub {
+ $intf->{ippp0} ||= { DEVICE => "ippp0" }; # we want the ifcfg-ippp0 file to be written
+ @isdn_dial_methods = ({ name => N("Automatically at boot"),
+ ONBOOT => 1, DIAL_ON_BOOT => 1 },
+ { name => N("By using Net Applet in the system tray"),
+ ONBOOT => 0, DIAL_ON_BOOT => 1 },
+ { name => N("Manually (the interface would still be activated at boot)"),
+ ONBOOT => 1, DIAL_ON_BOOT => 0 });
+ my $method = find {
+ $_->{ONBOOT} eq text2bool($intf->{ippp0}{ONBOOT}) and
+ $_->{DIAL_ON_BOOT} eq text2bool($intf->{ippp0}{DIAL_ON_BOOT})
+ } @isdn_dial_methods;
+ #- use net_applet by default
+ $isdn->{dial_method} = $method->{name} || $isdn_dial_methods[1]->{name};
+ },
+ name => N("How do you to dial this connection ?"),
+ data => sub {
+ [ { type => "list", val => \$isdn->{dial_method}, list => [ map { $_->{name} } @isdn_dial_methods ] } ]
+ },
+ post => sub {
+ my $method = find { $_->{name} eq $isdn->{dial_method} } @isdn_dial_methods;
+ $intf->{ippp0}{$_} = bool2yesno($method->{$_}) foreach qw(ONBOOT DIAL_ON_BOOT);
+ return $after_start_on_boot_step->();
+ },
+ },
+
restart =>
{
name => N("The network needs to be restarted. Do you want to restart it ?"),
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index bd40ffbcd..f75d61c9a 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -166,7 +166,8 @@ sub write_interface_conf {
setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST ONBOOT HWADDR MII_NOT_SUPPORTED),
qw(WIRELESS_MODE WIRELESS_ESSID WIRELESS_NWID WIRELESS_FREQ WIRELESS_SENS WIRELESS_RATE WIRELESS_ENC_KEY WIRELESS_RTS WIRELESS_FRAG WIRELESS_IWCONFIG WIRELESS_IWSPY WIRELESS_IWPRIV),
- if_($intf->{BOOTPROTO} eq "dhcp", qw(DHCP_HOSTNAME NEEDHOSTNAME))
+ if_($intf->{BOOTPROTO} eq "dhcp", qw(DHCP_HOSTNAME NEEDHOSTNAME)),
+ if_($intf->{DEVICE} =~ /^ippp\d+$/, qw(DIAL_ON_BOOT))
);
log::explanations("written $intf->{DEVICE} interface configuration in $file");
}