Added auto-off for WiFi while LAN connection.
authorAndreas Schiermeier <andreas@schiermeier.name>
Fri, 8 Jan 2016 04:45:33 +0000 (05:45 +0100)
committerAndreas Schiermeier <andreas@schiermeier.name>
Fri, 8 Jan 2016 04:45:33 +0000 (05:45 +0100)
modules/system/files/etc/NetworkManager/dispatcher.d/99-wlan [new file with mode: 0755]
modules/system/manifests/init.pp

diff --git a/modules/system/files/etc/NetworkManager/dispatcher.d/99-wlan b/modules/system/files/etc/NetworkManager/dispatcher.d/99-wlan
new file mode 100755 (executable)
index 0000000..6bbf1ed
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+IFACE=$1
+ACTION=$2
+
+case ${IFACE} in
+       eth*|usb*)
+               case ${ACTION} in
+                       up)
+                               nmcli r wifi off
+                       ;;
+                       down)
+                               nmcli r wifi on
+                       ;;
+               esac
+       ;;
+esac
index 6bc90a5..8693403 100644 (file)
@@ -101,6 +101,13 @@ class system {
                require => Package['network-manager'],
        }
 
+       file { '/etc/NetworkManager/dispatcher.d/99-wlan':
+               ensure => file,
+               source => 'puppet:///modules/system/etc/NetworkManager/dispatcher.d/99-wlan',
+               mode => 'a=r',
+               require => Package['network-manager'],
+       }
+
        file { '/etc/NetworkManager/system-connections/ffm.freifunk.net':
                ensure => file,
                source => 'puppet:///modules/system/etc/NetworkManager/system-connections/ffm.freifunk.net',