3 # Debian ifupdown hook script for madwifi-ng
5 # Author: Matt Brown <matt@mattb.net.nz>
6 # Modified by: Kel Modderman <kelrin@tpg.com.au>
8 # Copyright (C) 2005 - 2006 Matt Brown
10 # This is free software; you can redistribute it and/or modify it under the
11 # terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at your option) any later
15 # This is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
20 # On Debian GNU/Linux systems, the text of the GPL license can be found in
21 # /usr/share/common-licenses/GPL
24 WLANCONFIG=/sbin/wlanconfig
26 if [ ! -x "$WLANCONFIG" ]; then
30 if [ ! -n "$IF_MADWIFI_BASE" ]; then
34 if [ "$VERBOSITY" = "1" ]; then
40 if [ -n "$IF_MADWIFI_MODE" ]; then
41 MODE="$IF_MADWIFI_MODE"
42 elif [ -n "$IF_WIRELESS_MODE" ]; then
43 MODE="$IF_WIRELESS_MODE"
48 if [ -n "$IF_MADWIFI_VAP" ]; then
54 if [ -d /proc/sys/net/$VAP ]; then
55 $WLANCONFIG $VAP destroy
59 Managed|managed|MANAGED)
68 Monitor|monitor|MONITOR)
71 sta|ap|wds|adhoc|ahdemo|monitor)
79 if [ -n "$IF_MADWIFI_OPTIONS" ]; then
80 $WLANCONFIG $VAP create wlandev $IF_MADWIFI_BASE wlanmode $MODE "$IF_MADWIFI_OPTIONS" >$TO_NULL
82 $WLANCONFIG $VAP create wlandev $IF_MADWIFI_BASE wlanmode $MODE >$TO_NULL