diff options
author | Arnaud Desmons <adesmons@mandriva.com> | 2002-08-07 09:51:48 +0000 |
---|---|---|
committer | Arnaud Desmons <adesmons@mandriva.com> | 2002-08-07 09:51:48 +0000 |
commit | 6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7 (patch) | |
tree | d3458cdfe4b2e744390e569a8837e1b8065b2479 | |
parent | 69d77d2e039c05875fe2ae15e86c29121db5b530 (diff) | |
download | drakwizard-6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7.tar drakwizard-6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7.tar.gz drakwizard-6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7.tar.bz2 drakwizard-6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7.tar.xz drakwizard-6b1badfc68e62482b8f0d3eb69c7524a3e7adaf7.zip |
drakconnect conf file parser
-rw-r--r-- | common/scripts/DrakconnectConf.pm | 36 |
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}; +} |