summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2009-08-14 15:31:39 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2009-08-14 15:31:39 +0000
commitcc65b8d0cc6c0ced59285cf34f6c3c8f8ef17fdd (patch)
treedaeeeae2020dc5dad57024da41bc546dc554f59c /lib
parent6626fd4c393477c4686a7823c03660a983c3accf (diff)
downloaddrakx-net-cc65b8d0cc6c0ced59285cf34f6c3c8f8ef17fdd.tar
drakx-net-cc65b8d0cc6c0ced59285cf34f6c3c8f8ef17fdd.tar.gz
drakx-net-cc65b8d0cc6c0ced59285cf34f6c3c8f8ef17fdd.tar.bz2
drakx-net-cc65b8d0cc6c0ced59285cf34f6c3c8f8ef17fdd.tar.xz
drakx-net-cc65b8d0cc6c0ced59285cf34f6c3c8f8ef17fdd.zip
Implemented netprofile module management.
Diffstat (limited to 'lib')
-rw-r--r--lib/network/network.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/network/network.pm b/lib/network/network.pm
index 8170d4a..ebcf9ca 100644
--- a/lib/network/network.pm
+++ b/lib/network/network.pm
@@ -395,6 +395,34 @@ sub gateway {
join(".", @masked);
}
+sub netprofile_modules() {
+ my @m = split('\n', `/sbin/netprofile modules`);
+ my @modules = ();
+
+ foreach my $module (@m) {
+ my @params = split('\t', $module);
+ my $vals = {
+ module => @params[0],
+ enabled => @params[1] == '+' ? 1 : 0,
+ name => @params[2],
+ description => @params[3],
+ };
+ push(@modules, $vals);
+ }
+ @modules;
+}
+
+sub netprofile_module_enable {
+ my ($module) = @_;
+ system('/sbin/netprofile', 'module_enable', $module);
+ log::explanations(qq(Enabling netprofile module $module));
+}
+
+sub netprofile_module_disable {
+ my ($module) = @_;
+ system('/sbin/netprofile', 'module_disable', $module);
+ log::explanations(qq(Disabling netprofile module $module));
+}
sub netprofile_set {
my ($net, $profile) = @_;