diff --git a/hardware/raspberrypi/wifi/files/default-wifi-powersave.conf b/hardware/raspberrypi/wifi/files/default-wifi-powersave.conf deleted file mode 100644 index 9333932..0000000 --- a/hardware/raspberrypi/wifi/files/default-wifi-powersave.conf +++ /dev/null @@ -1,3 +0,0 @@ -# disable powersave -[connection] -wifi.powersave = 2 diff --git a/hardware/raspberrypi/wifi/files/interfaces-wlan0 b/hardware/raspberrypi/wifi/files/interfaces-wlan0 new file mode 100644 index 0000000..af96d98 --- /dev/null +++ b/hardware/raspberrypi/wifi/files/interfaces-wlan0 @@ -0,0 +1,6 @@ +# SALTSTACK +allow-hotplug wlan0 +iface wlan0 inet dhcp + wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf + wireless-power off + \ No newline at end of file diff --git a/hardware/raspberrypi/wifi/files/wifi-powermanagement-off b/hardware/raspberrypi/wifi/files/wifi-powermanagement-off deleted file mode 100644 index cd6a62c..0000000 --- a/hardware/raspberrypi/wifi/files/wifi-powermanagement-off +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -IWCONFIG=/sbin/iwconfig -WLAN_IFACE=wlan0 - -if [ ! -x $IWCONFIG ]; then - exit 1 -fi - -if [ "$IFACE" = $WLAN_IFACE ]; then - $IWCONFIG $IFACE power off -fi \ No newline at end of file diff --git a/hardware/raspberrypi/wifi/init.sls b/hardware/raspberrypi/wifi/init.sls index 268bbca..dfd5226 100644 --- a/hardware/raspberrypi/wifi/init.sls +++ b/hardware/raspberrypi/wifi/init.sls @@ -1,22 +1,8 @@ # disable wifi powermanagement -nm-conf_d: - file.directory: - - name: /etc/NetworkManager/conf.d - -nm-conf_powersave-off: +ifup-wlan0-powersave-off: file.managed: - - name: /etc/NetworkManager/conf.d/default-wifi-powersave.conf - - source: - - salt://hardware/raspberrypi/wifi/files/default-wifi-powersave.conf - - require: - - file: /etc/NetworkManager/conf.d - -if-up_powersave-off: - file.managed: - - name: /etc/network/if-up.d/wifi-powermanagement-off - - mode: 0755 - - source: - - salt://hardware/raspberrypi/wifi/files/wifi-powermanagement-off - + - name: /etc/network/interfaces.d/wlan0 + - source: + - salt://hardware/raspberrypi/wifi/files/interfaces-wlan0