#!/bin/sh # # wled # WIRELESS_LED=/proc/acpi/asus/wled IWCONFIG=/sbin/iwconfig # $IFACE is set by ifup/down, $PPP_IFACE by pppd [ -n "$PPP_IFACE" ] && IFACE=$PPP_IFACE [ -r $WIRELESS_LED ] || /sbin/modprobe asus_acpi if [ -x $IWCONFIG ]; then IS_WIRELESS=$($IWCONFIG $IFACE 2>/dev/null |grep ^$IFACE |wc -l) if [ $IS_WIRELESS -eq 1 -a -w $WIRELESS_LED ]; then case $(dirname "$0") in */if-up.d) echo -n 1 > $WIRELESS_LED ;; */if-down.d) echo -n 0 > $WIRELESS_LED ;; esac fi fi