From 222f217dca70c6e7b6f5049a937bb2edd9e24a89 Mon Sep 17 00:00:00 2001 From: Preston Brown Date: Wed, 26 Jun 2002 20:43:06 +0000 Subject: escape quotes for NICKNAME and ESSID. Only try to set channel/freq when in Ad-Hoc mode. --- sysconfig/network-scripts/ifup-wireless | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'sysconfig/network-scripts/ifup-wireless') diff --git a/sysconfig/network-scripts/ifup-wireless b/sysconfig/network-scripts/ifup-wireless index ace878f4..537eadcd 100755 --- a/sysconfig/network-scripts/ifup-wireless +++ b/sysconfig/network-scripts/ifup-wireless @@ -1,6 +1,6 @@ #!/bin/bash # Network Interface Configuration System -# Copyright (c) 1996-2001 Red Hat, Inc. all rights reserved. +# Copyright (c) 1996-2002 Red Hat, Inc. all rights reserved. # # Based on PCMCIA wireless script by (David Hinds/Jean Tourrilhes) # @@ -34,17 +34,17 @@ if [ -n "$MODE" ] ; then iwconfig $DEVICE mode $MODE fi # This is a bit hackish, but should do the job right... -if [ -n "$ESSID" ] || [ -n "$MODE" ] ; then +if [ -n "$ESSID" -o -n "$MODE" ] ; then NICKNAME=`/bin/hostname` - iwconfig $DEVICE nick $NICKNAME >/dev/null 2>&1 + iwconfig $DEVICE nick \"$NICKNAME\" >/dev/null 2>&1 fi # Regular stuff... if [ -n "$NWID" ] ; then iwconfig $DEVICE nwid $NWID fi -if [ -n "$FREQ" ] ; then +if [ -n "$FREQ" -a "$MODE" != "Managed" ] ; then iwconfig $DEVICE freq $FREQ -elif [ -n "$CHANNEL" ] ; then +elif [ -n "$CHANNEL" -a "$MODE" != "Managed" ] ; then iwconfig $DEVICE channel $CHANNEL fi if [ -n "$SENS" ] ; then @@ -55,6 +55,8 @@ if [ -n "$RATE" ] ; then fi if [ -n "$KEY" ] ; then iwconfig $DEVICE key $KEY +else + iwconfig $DEVICE key off fi if [ -n "$RTS" ] ; then iwconfig $DEVICE rts $RTS @@ -81,5 +83,5 @@ fi # when this is set, and things like encryption keys are better be # defined if we want to discover the right set of APs/nodes. if [ -n "$ESSID" ] ; then - iwconfig $DEVICE essid "$ESSID" + iwconfig $DEVICE essid \"$ESSID\" fi -- cgit v1.2.1