From 8841f50912a604e3e4d313a68e979e388b198fe1 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 6 Sep 2004 11:40:26 +0000 Subject: (ppp_read_conf) try to read kppp config from user dir --- perl-install/network/modem.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'perl-install/network/modem.pm') 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}; -- cgit v1.2.1