Disable net_applet if found NM-controlled interface

Alexander Kazancev <[email protected]>
Newsgroups gmane.linux.mandrake.cooker.devel
Message-ID <CAAqM-Af5mG5NObFf2WSS8Oc_oSpSXubrdjH=c+2szFOJfiqmuw@mail.gmail.com>
Since last drak-net update to 0.96 version net_applet now autostart,
even all interface NM-enabled. It's not correct.

May be we will use this small patch:

--- drakx-net-0.96/bin/net_applet	2012-01-15 01:25:37.000000000 +0400
+++ drakx-net-0.96/bin/net_applet.new	2012-01-15 23:22:09.000000000 +0400
@@ -28,6 +28,21 @@
 my $system_file = '/etc/sysconfig/drakx-net';
 shouldStart() or die "$onstartupfile should be set to TRUE or use
net_applet --force\n";

+#Check for NM
+	foreach (all("$::prefix/etc/sysconfig/network-scripts")) {
+	my ($device) = /^ifcfg-([A-Za-z0-9.:_-]+)$/;
+	next if $device =~ /.rpmnew$|.rpmsave$/;
+	if ($device && $device ne 'lo') {
+		my $file = network::network::get_ifcfg_file($device);
+		my $NM_control = { getVarsFromSh($file) }->{NM_CONTROLLED};
+		if ( $NM_control eq 'yes')
+			{
+				print "Found NM-controlled interface";
+				exit;
+			}
+	}
+    }
+
 #- Allow multiple instances, but only one per user:
 is_running('net_applet') and die "net_applet already running\n";

It's check interface cfg file and if find NM_ENABLED exit nm_applet.
If this usefull, i add patch to cooker

-- 
Chief of educational programs Mandriva Russia (http://edumandriva.ru)
Alexander Kazancev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.