aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorPreston Brown <pbrown@redhat.com>2002-06-26 20:43:06 +0000
committerPreston Brown <pbrown@redhat.com>2002-06-26 20:43:06 +0000
commit222f217dca70c6e7b6f5049a937bb2edd9e24a89 (patch)
tree9d667cb1f74ce8902778c4cedacd7c76294cc0fb /sysconfig
parent6ff1270b8bd3c608fe230a0f983662c84c61fa6a (diff)
downloadinitscripts-222f217dca70c6e7b6f5049a937bb2edd9e24a89.tar
initscripts-222f217dca70c6e7b6f5049a937bb2edd9e24a89.tar.gz
initscripts-222f217dca70c6e7b6f5049a937bb2edd9e24a89.tar.bz2
initscripts-222f217dca70c6e7b6f5049a937bb2edd9e24a89.tar.xz
initscripts-222f217dca70c6e7b6f5049a937bb2edd9e24a89.zip
escape quotes for NICKNAME and ESSID. Only try to set channel/freq when in Ad-Hoc mode.
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifup-wireless14
1 files changed, 8 insertions, 6 deletions
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