summaryrefslogtreecommitdiffstats
path: root/common/scripts/IFCFG.pm
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-12-09 17:24:23 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-12-09 17:24:23 +0000
commit8f5aea5c59228ff4e71ba8951313d59fbfd99723 (patch)
tree2e42ca12d617f961c424ec55e3eb15f16667f6ab /common/scripts/IFCFG.pm
parentcef4fffc8767d73ee93b8885a8615cbe5ef1b5d0 (diff)
downloaddrakwizard-8f5aea5c59228ff4e71ba8951313d59fbfd99723.tar
drakwizard-8f5aea5c59228ff4e71ba8951313d59fbfd99723.tar.gz
drakwizard-8f5aea5c59228ff4e71ba8951313d59fbfd99723.tar.bz2
drakwizard-8f5aea5c59228ff4e71ba8951313d59fbfd99723.tar.xz
drakwizard-8f5aea5c59228ff4e71ba8951313d59fbfd99723.zip
No more use of drakconnect_conf, use of IFCFG.pm instead of DrakconnectConf.pm
Diffstat (limited to 'common/scripts/IFCFG.pm')
-rw-r--r--common/scripts/IFCFG.pm22
1 files changed, 7 insertions, 15 deletions
diff --git a/common/scripts/IFCFG.pm b/common/scripts/IFCFG.pm
index 00a98845..2d1171ba 100644
--- a/common/scripts/IFCFG.pm
+++ b/common/scripts/IFCFG.pm
@@ -23,11 +23,11 @@ use strict;
use Data::Dumper;
use MDK::Common;
-my $file = "/etc/sysconfig/network-scripts/drakconnect_conf";
-!-f $file and die "no such $file";
+#my $file = "/etc/sysconfig/network-scripts/drakconnect_conf";
+#!-f $file and die "no such $file";
sub new {
my $self = {};
-
+
$ENV{PATH} = "";
my $ifconfig = `LC_ALL=C /sbin/ifconfig -a`;
my $device = 'NONE';
@@ -42,7 +42,7 @@ sub new {
$self->{itf}{$device}{$_} = $conf{$_} foreach ('BOOTPROTO');
}
}
- $self->{network} = getVarsFromSh("/etc/sysconfig/network");
+ %{$self->{network}} = getVarsFromSh("/etc/sysconfig/network");
bless $self;
}
@@ -54,15 +54,6 @@ sub is_dhcp {
$self->{itf}{$itf}{BOOTPROTO} eq 'dhcp';
}
-
-sub get {
- my $self = shift;
- my ($key1, $key2) = @_;
-
- exists $self->{$key1}{$key2} or die "no $key1 $key2 field in $file";
- $self->{$key1}{$key2};
-}
-
#- TODO : return the main interface
sub default_itf {
"eth0";
@@ -73,7 +64,7 @@ sub itf_get {
my ($key, $itf) = @_;
$itf ||= default_itf;
- exists $self->{itf}{$itf}{$key} or die "no $key field in $file";
+ exists $self->{itf}{$itf}{$key} or die "no $key field in $itf hash";
$self->{itf}{$itf}{$key}
}
@@ -81,7 +72,8 @@ sub network_get {
my $self = shift;
my ($key) = @_;
- get("network", $key);
+ exists $self->{network}->{$key} or die "no $key field in network hash";
+ $self->{network}{$key};
}
10;