summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-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;