Updated the /etc/init.d/iwmf init-script with fixes from lizh

#!/bin/sh /etc/rc.common

START=99
USE_PROCD=1

service_triggers()
{
        procd_add_reload_trigger wireless
}

start_service()
{
        config_load wireless
        # Trying to catch all ifaces
        for vif in $(uci -q -X show wireless | grep "ifname" | cut -d'.' -f2); do
        # Ignoriing disabled ifaces for $i
        local disabled
        config_get_bool disabled "$vif" disabled
        if [ "$disabled" = "0" -o "$disabled" = "" ]; then
                # Setting up variables for check for $vif
                config_get maclist "$vif" maclist
                #If there were configured the maclist for the iface, we proceed
                if [ -n "$maclist" ]; then
                        # Get ifname
                        config_get ifname "$vif" ifname
                        # flush MAC list
                        iwpriv "$ifname" maccmd 3
                        # Send the MACs to the card
                        for mac in $maclist; do
                                iwpriv "$ifname" addmac "$mac"
                        done
                        # Get the policy
                        config_get macfilter "$vif" macfilter
                        # Set up the policy on the card
                        case "$macfilter" in
                                allow)
                                        iwpriv "$ifname" maccmd 1
                                ;;
                                deny)
                                        iwpriv "$ifname" maccmd 2
                                ;;
                                *)
                                        # So, there policy is not setted, but there is maclist... Why?..
                                        # May be the user turned off the policy, but keep the maclist?..
                                        # If that is true, we should flush the maclist on the iface
                                        iwpriv "$ifname" maccmd 3
                                        return 0
                                ;;
                        esac
                fi
        fi
        done
}

stop_service()
{
        return 0
}

restart_service()
{
        start_service
}