blob: 2efb1a661353ffa4f6113cc99ea73319ea48ecc9 [file] [log] [blame]
IWCONFIG=iwconfig
if [ x$CONTROL_WIFI_POWER = x1 ] ; then
if [ $ON_AC -eq 1 ] ; then
power_mgmt="off"
else
power_mgmt="on"
fi
for DEVICE in /sys/class/net/* ; do
if [ -d $DEVICE/wireless ]; then
dev=`basename $DEVICE`
$IWCONFIG $dev power $power_mgmt
ret=$?
if [ "$ret" = "0" ]; then
log "VERBOSE" "Power Management set to $power_mgmt for $dev."
else
log "VERBOSE" "Failed to set Power Management to $power_mgmt for $dev."
fi
fi
done
else
log "VERBOSE" "WiFi power setting is disabled."
fi