Browse Source

Add files via upload

7-11-2020 This is an update to the original wlan_pwr by Steve Ford.  It addresses issues in Debian 8.11. This script has not been tested on Debian 8.3.
master
kenmartin-unix 4 years ago
committed by GitHub
parent
commit
0c82752256
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 46 additions and 0 deletions
  1. +46
    -0
      wlan_pwr

+ 46
- 0
wlan_pwr View File

@@ -0,0 +1,46 @@
#! /bin/sh
# wlan_pwr -- version: "11-Apr-2020"
# Tested on Debian 8.3 and Debian 8.11
# Improve CHIP's wireless performance by turning off power management.

set -e

# Log settings new
echo "wlan_pwr: IFACE $IFACE, MODE $MODE, ADDRFAM $ADDRFAM"

# Don't bother for loopback
if [ "$IFACE" = lo ]; then
exit 0
fi

# Only run from ifup.
if [ "$MODE" != start ]; then
exit 0
fi

# old off
# Only do it once (skip for inet6).
# if [ "$ADDRFAM" != inet ]; then
# exit 0
# fi

# Hopefully wireless-tools is installed
if [ ! -x /sbin/iw ]; then
exit 0
fi

# New
# The IFACE argument is not passed
# /sbin/iw dev $IFACE set power_save off
# Insert run through available wlans
echo "wlan_pwr: Setting power saving to off"
for wifi in `ip a | grep wlan | cut -f2 -d ' ' | sed "s/://"`
do
echo "wlan_pwr: Power save to off for $wifi"
/sbin/iw dev $wifi set power_save off
echo -n "wlan_pwr: $wifi is set to "
/sbin/iw dev $wifi get power_save
done

exit 0


Loading…
Cancel
Save