summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-08-07 09:51:48 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-08-07 09:51:48 +0000
commit6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7 (patch)
treed3458cdfe4b2e744390e569a8837e1b8065b2479 /common
parent69d77d2e039c05875fe2ae15e86c29121db5b530 (diff)
downloaddrakwizard-6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7.tar
drakwizard-6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7.tar.gz
drakwizard-6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7.tar.bz2
drakwizard-6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7.tar.xz
drakwizard-6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7.zip
drakconnect conf file parser
Diffstat (limited to 'common')
-rw-r--r--common/scripts/DrakconnectConf.pm36
1 files changed, 36 insertions, 0 deletions
diff --git a/common/scripts/DrakconnectConf.pm b/common/scripts/DrakconnectConf.pm
new file mode 100644
index 00000000..9b9a4e06
--- /dev/null
+++ b/common/scripts/DrakconnectConf.pm
@@ -0,0 +1,36 @@
+#!/usr/bin/perl
+
+package DrakconnectConf;
+require "__WIZ_HOME__/common/scripts/Vareqval.pm";
+use strict;
+
+sub new {
+ my $self = {};
+
+ my %mdk = Vareqval->get("/etc/sysconfig/network-scripts/drakconnect_conf");
+ $self->{mdk} = \%mdk;
+ foreach (keys %{$self->{mdk}}) {
+ if (/.*(Eth\d)Known.*/) {
+ my $device = $1;
+ if ($self->{mdk}{$_} =~ /.*true.*/) {
+ $self->{device} = $device;
+ }
+ }
+ }
+ bless $self;
+}
+
+sub get {
+ my $self = shift;
+ my $key = shift;
+
+ return $self->{mdk}->{$key};
+}
+
+sub get_from_known_dev {
+ my $self = shift;
+ my $arg = shift;
+
+ my $device = $self->{device};
+ return $self->{mdk}{$device.$arg};
+}