Here's the old RedHat ifup-wireless script below. There used to be a config file per interface to set the variables.<br>Ken<br>--------------------<br>#!/bin/bash<br># Network Interface Configuration System<br># Copyright (c) 1996-2002 Red Hat, Inc. all rights reserved.<br>
#<br># Based on PCMCIA wireless script by (David Hinds/Jean Tourrilhes)<br>#<br># This software may be freely redistributed under the terms of the GNU<br># public license.<br># <br># You should have received a copy of the GNU General Public License<br>
# along with this program; if not, write to the Free Software<br># Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.<br>#<br># Configure wireless network device options. See iwconfig(8) for more info.<br># Valid variables:<br>
# MODE: Ad-Hoc, Managed, etc.<br># ESSID: Name of the wireless network<br># NWID: Name of this machine on the network. Hostname is default<br># FREQ: Frequency to operate on. See CHANNEL<br># CHANNEL: Numbered frequency to operate on. See FREQ<br>
# SENS: Sensitivity threshold for packet rejection.<br># RATE: Transfer rate. Usually one of Auto, 11, 5, 2, or 1.<br># KEY: Encryption key for WEP.<br># RTS: Explicit RTS handshake. Usually not specified (auto)<br>
# FRAG: Fragmentation threshold to split packets. Usually not specified.<br># SPYIPS: List of IP addresses to "spy" on for link performance stats.<br># IWCONFIG: Extra parameters to pass directly to IWCONFIG<br>
# SECURITYMODE: Security mode, e.g: 'open' or 'restricted'<br># IWPRIV: Extra parameters to pass directly to IWPRIV<br><br># Only meant to be called from ifup.<br><br># Mode need to be first : some settings apply only in a specific mode !<br>
if [ -n "$MODE" ] ; then<br> /sbin/iwconfig $DEVICE mode $MODE<br>fi<br># This is a bit hackish, but should do the job right...<br>if [ -n "$ESSID" -o -n "$MODE" ] ; then<br> NICKNAME=`/bin/hostname`<br>
/sbin/iwconfig $DEVICE nick "$NICKNAME" >/dev/null 2>&1<br>fi<br># Regular stuff...<br>if [ -n "$NWID" ] ; then<br> /sbin/iwconfig $DEVICE nwid $NWID<br>fi<br>if [ -n "$FREQ" -a "$MODE" != "Managed" ] ; then<br>
/sbin/iwconfig $DEVICE freq $FREQ<br>elif [ -n "$CHANNEL" -a "$MODE" != "Managed" ] ; then<br> /sbin/iwconfig $DEVICE channel $CHANNEL<br>fi<br>if [ -n "$SENS" ] ; then<br> /sbin/iwconfig $DEVICE sens $SENS<br>
fi<br>if [ -n "$RATE" ] ; then<br> /sbin/iwconfig $DEVICE rate "$RATE"<br>fi<br>if [ -n "$KEY" -o -n "$KEY1" -o -n "$KEY2" -o -n "$KEY3" -o -n "$KEY4" ] ; then<br>
[ -n "$KEY1" ] && /sbin/iwconfig $DEVICE key [1] $KEY1<br> [ -n "$KEY2" ] && /sbin/iwconfig $DEVICE key [2] $KEY2<br> [ -n "$KEY3" ] && /sbin/iwconfig $DEVICE key [3] $KEY3<br>
[ -n "$KEY4" ] && /sbin/iwconfig $DEVICE key [4] $KEY4<br> [ -n "$DEFAULTKEY" ] && /sbin/iwconfig $DEVICE key [${DEFAULTKEY}]<br> [ -n "$KEY" ] && /sbin/iwconfig $DEVICE key $KEY<br>
else<br> echo no keys<br> #/sbin/iwconfig $DEVICE key off<br>fi<br>if [ -n "$SECURITYMODE" ]; then<br> /sbin/iwconfig $DEVICE enc $SECURITYMODE<br>fi<br>if [ -n "$RTS" ] ; then<br> /sbin/iwconfig $DEVICE rts $RTS<br>
fi<br>if [ -n "$FRAG" ] ; then<br> /sbin/iwconfig $DEVICE frag $FRAG<br>fi<br><br># More specific parameters passed directly to IWCONFIG<br>if [ -n "$IWCONFIG" ] ; then<br> /sbin/iwconfig $DEVICE $IWCONFIG<br>
fi<br><br>if [ -n "$SPYIPS" ] ; then<br> for IP in $SPYIPS; do<br> /sbin/iwspy $DEVICE + $IP<br> done<br>fi<br>if [ -n "$IWPRIV" ] ; then<br> /sbin/iwpriv $DEVICE $IWPRIV<br>fi<br><br># ESSID need to be last : most device re-perform the scanning/discovery<br>
# when this is set, and things like encryption keys are better be<br># defined if we want to discover the right set of APs/nodes.<br>if [ -n "$ESSID" ] ; then<br> /sbin/iwconfig $DEVICE essid "$ESSID"<br>
else<br> # use any essid<br> /sbin/iwconfig $DEVICE essid any >/dev/null 2>&1<br>fi<br><br>if [ "$WPA" = "yes" -a -x /sbin/wpa_supplicant ]; then<br> /sbin/wpa_supplicant -Bw -Dwext -c/home/kshaf/Desktop/wpa_supplicant.conf -i $DEVICE<br>
fi<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
<br>
_______________________________________________<br>
sf-lug mailing list<br>
<a href="mailto:sf-lug@linuxmafia.com" target="_blank">sf-lug@linuxmafia.com</a><br>
<a href="http://linuxmafia.com/mailman/listinfo/sf-lug" target="_blank">http://linuxmafia.com/mailman/listinfo/sf-lug</a><br>
Information about SF-LUG is at <a href="http://www.sf-lug.org/" target="_blank">http://www.sf-lug.org/</a><br>
</div></blockquote></div><br>
</blockquote></div><br>