diff options
author | Damien Chaumette <dchaumette@mandriva.com> | 2004-01-29 17:01:08 +0000 |
---|---|---|
committer | Damien Chaumette <dchaumette@mandriva.com> | 2004-01-29 17:01:08 +0000 |
commit | 4515b0a29940291b8afaab8c2d178362023c7052 (patch) | |
tree | 46a1a8941a038ce3f14165e01579a06b8733c7a2 /perl-install/standalone/drakconnect | |
parent | 726b8b31a13f5565cd946d6cd0cef7e92984ed18 (diff) | |
download | drakx-backup-do-not-use-4515b0a29940291b8afaab8c2d178362023c7052.tar drakx-backup-do-not-use-4515b0a29940291b8afaab8c2d178362023c7052.tar.gz drakx-backup-do-not-use-4515b0a29940291b8afaab8c2d178362023c7052.tar.bz2 drakx-backup-do-not-use-4515b0a29940291b8afaab8c2d178362023c7052.tar.xz drakx-backup-do-not-use-4515b0a29940291b8afaab8c2d178362023c7052.zip |
shrink
Diffstat (limited to 'perl-install/standalone/drakconnect')
-rwxr-xr-x | perl-install/standalone/drakconnect | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect index 7273ccffc..b82eb8c7b 100755 --- a/perl-install/standalone/drakconnect +++ b/perl-install/standalone/drakconnect @@ -252,21 +252,12 @@ sub build_tree { # FIXME: code duplication, should be in network::modem::read_config $intf->{device} = $netc->{autodetect}{modem}; my %l = getVarsFromSh("$::prefix/usr/share/config/kppprc"); - $intf->{connection} = $l{Name}; - $intf->{domain} = $l{Domain}; ($intf->{dns1}, $intf->{dns2}) = split(',', $l{DNS}); - - foreach (cat_("/etc/sysconfig/network-scripts/chat-ppp0")) { - /.*ATDT(\d*)/ and $intf->{phone} = $1; - } - foreach (cat_("/etc/sysconfig/network-scripts/ifcfg-ppp0")) { - /NAME=(['"]?)(.*)\1/ and $intf->{login} = $2; - } - $intf->{login} ||= $l{Username}; - my $secret = network::tools::read_secret_backend(); - foreach (@$secret) { - $intf->{passwd} = $_->{passwd} if $_->{login} eq $intf->{login}; - } + $intf->{$_->[0]} = $l{$_->[1]} foreach [ 'connection' , 'Name' ], [ 'domain', 'Domain' ], [ 'login', 'Username' ]; + /.*ATDT(\d*)/ and $intf->{phone} = $1 foreach cat_("/etc/sysconfig/network-scripts/chat-ppp0"); + /NAME=(['"]?)(.*)\1/ and $intf->{login} ||= $2 foreach cat_("/etc/sysconfig/network-scripts/ifcfg-ppp0"); + my $security = network::tools::read_secret_backend(); + $_->{login} eq $intf->{login} and $intf->{passwd} = $_->{passwd} foreach @$security; $intf->{save} = sub { network::modem::ppp_configure($in, $intf) }; } elsif ($interface eq 'isdn') { |