#!/bin/bash
# Change the wireless power mode to AC.
#   This should work for most chipsets
#
# based on https://wiki.ubuntu.com/ReducedPowerUsage

for x in $(/bin/ls -d /sys/class/net/*/wireless | /usr/bin/cut -d'/' -f5); do
    /sbin/iwconfig $x power off
    /sbin/iwpriv $x set_power 6
done
