summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-09-06 11:40:26 +0000
committerOlivier Blin <oblin@mandriva.org>2004-09-06 11:40:26 +0000
commit8841f50912a604e3e4d313a68e979e388b198fe1 (patch)
tree3931d6cc7bc5a7bb0dce9855c2c9f2ef4e4ac823 /perl-install
parent716b10cd43925a632ea8e6981c8c3075c7a2f257 (diff)
downloaddrakx-backup-do-not-use-8841f50912a604e3e4d313a68e979e388b198fe1.tar
drakx-backup-do-not-use-8841f50912a604e3e4d313a68e979e388b198fe1.tar.gz
drakx-backup-do-not-use-8841f50912a604e3e4d313a68e979e388b198fe1.tar.bz2
drakx-backup-do-not-use-8841f50912a604e3e4d313a68e979e388b198fe1.tar.xz
drakx-backup-do-not-use-8841f50912a604e3e4d313a68e979e388b198fe1.zip
(ppp_read_conf) try to read kppp config from user dir
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/modem.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm
index 9cd9750ef..b9a6603ff 100644
--- a/perl-install/network/modem.pm
+++ b/perl-install/network/modem.pm
@@ -13,6 +13,15 @@ sub first_modem {
first(grep { $_->{device} =~ m!^/dev! } values %{$netc->{autodetect}{modem}});
}
+sub get_user_home() {
+ my $home;
+ if ($ENV{USER} ne "root") {
+ #- kdesu case
+ $home = (find { $_->[0] eq $ENV{USER} } list_passwd())->[7];
+ }
+ $home ||= $ENV{HOME}; #- consolehelper case
+ $home;
+}
sub ppp_read_conf {
my ($netcnx, $netc) = @_;
@@ -21,7 +30,8 @@ sub ppp_read_conf {
$modem->{device} ||= $detected_modem->{device};
}
$modem->{device} ||= '/dev/modem';
- my %l = getVarsFromSh("$::prefix/usr/share/config/kppprc");
+ my %l = getVarsFromSh(get_user_home() . "/.kde/share/config/kppprc");
+ add2hash(\%l, getVarsFromSh("$::prefix/usr/share/config/kppprc"));
$l{Authentication} = 4 if !exists $l{Authentication};
$modem->{$_} ||= $l{$_} foreach qw(Authentication Gateway IPAddr SubnetMask);
$modem->{connection} ||= $l{Name};