summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
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};
+}