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