]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Move setting wireless specific settings into separate wireless_param() function and...
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 5 Dec 2003 20:30:33 +0000 (20:30 +0000)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 5 Dec 2003 20:30:33 +0000 (20:30 +0000)
svn-id: @1721

sysconfig/network-scripts/functions.network
sysconfig/network-scripts/ifup
sysconfig/network-scripts/ifup-br

index d69d0dcf17e4528b5f8b977a8d6e46007923b345..659311f2c59a2795b2a53d6d4b32b7cb2bb408b4 100644 (file)
@@ -433,6 +433,76 @@ is_wireless_device () {
     return 1
 }
 
+wireless_param () {
+    
+    device="$1"
+    if [ "$2" = "br" ]; then
+       prefix="${device}_"
+    else
+       prefix=""
+    fi
+    
+    if [ -z "$(eval echo \$${prefix}WLAN_NICKNAME)" ]; then
+        WLAN_NICKNAME="$(hostname -f)"
+    else            
+        WLAN_NICKANME="$(eval echo \$${prefix}WLAN_NICKNAME)"
+    fi
+    
+    # wlan mode needs to be first
+    [ -n "$(eval echo \$${prefix}WLAN_MODE)" ] && iwconfig ${device} \
+        mode "$(eval echo \$${prefix}WLAN_MODE)"
+    iwconfig ${device} nickname WLAN_NICKNAME
+    [ -n "$(eval echo \$${prefix}WLAN_ESSID)" ] && iwconfig ${device} \
+        essid "$(eval echo \$${prefix}WLAN_ESSID)"
+    [ -n "$(eval echo \$${prefix}WLAN_NWID)" ] && iwconfig ${device} \
+       nwid "$(eval echo \$${prefix}WLAN_NWID)"
+    if [ -n "$(eval echo \$${prefix}WLAN_FREQ)" -a "$(eval echo \$${prefix}${WLAN_MODE})" != "Managed" ] ; then
+       iwconfig ${device} freq "$(eval echo \$${prefix}WLAN_FREQ)"
+    elif [ -n "$(eval echo \$${prefix}WLAN_CHANNEL)" -a "$(eval echo \$${prefix}${WLAN_MODE})" != "Managed" ]; then
+       iwconfig ${device} \
+       channel "$(eval echo \$${prefix}WLAN_CHANNEL)"
+    fi
+    [ -n "$(eval echo \$${prefix}WLAN_SENS)" ] && iwconfig ${device} \
+       sens "$(eval echo \$${prefix}WLAN_SENS)"
+    [ -n "$(eval echo \$${prefix}WLAN_AP)" ] && iwconfig ${device} \
+       ap "$(eval echo \$${prefix}WLAN_AP)"
+    [ -n "$(eval echo \$${prefix}WLAN_BITRATE)" ] && \
+       iwconfig ${device} \
+       rate "$(eval echo \$${prefix}WLAN_BITRATE)"
+    [ -n "$(eval echo \$${prefix}WLAN_RTS_THRESHOLD)" ] && \
+       iwconfig ${device} \
+       rts "$(eval echo \$${prefix}WLAN_RTS_THRESHOLD)"
+    [ -n "$(eval echo \$${prefix}WLAN_FRAGMENTATION_THRESHOLD)" ] && \
+       iwconfig ${device} \
+       frag "$(eval echo \$${prefix}WLAN_FRAGMENTATION_THRESHOLD)"
+    if [ -n "$(eval echo \$${prefix}WLAN_KEY)" ]; then
+       iwconfig ${device} key "$(eval echo \$${prefix}WLAN_KEY)"
+       [ -n "$(eval echo \$${prefix}WLAN_ENCRYPTION)" ] && \
+               iwconfig ${device} \
+               key "$(eval echo \$${prefix}WLAN_ENCRYPTION)"
+    fi
+    if is_no "$(eval echo \$${prefix}WLAN_ENCRYPTION)"; then
+       iwconfig ${device} key off
+    fi
+    [ -n "$(eval echo \$${prefix}WLAN_POWER)" ] && \
+       iwconfig ${device} "$(eval echo \$${prefix}WLAN_POWER)"
+    [ -n "$(eval echo \$${prefix}WLAN_TXPOWER)" ] && \
+       iwconfig ${device} "$(eval echo \$${prefix}WLAN_TXPOWER)"
+    [ -n "$(eval echo \$${prefix}WLAN_RETRY)" ] && \
+       iwconfig ${device} "$(eval echo \$${prefix}WLAN_RETRY)"
+    if is_yes "$(eval echo \$${prefix}WLAN_COMMIT)"; then
+       iwconfig ${device} commit
+    fi
+    [ -n "$(eval echo \$${prefix}WLAN_NWID)" ] && iwconfig ${device} \
+       nwid "$(eval echo \$${prefix}WLAN_NWID)"
+       
+    #essid should be last due to netowork rescanning by wlan devices
+    [ -n "$(eval echo \$${prefix}WLAN_ESSID)" ] && iwconfig ${device} \
+       essid "$(eval echo \$${prefix}WLAN_ESSID)"
+
+}
+
+
 # This must be last line !
 # vi:syntax=sh:tw=78:ts=8:sw=4
 
index 9a74443ad752eca7ed406cedd006f6ebfc3ad804..a8b162924737a2ef84dffb1a1a17c09b70369115 100755 (executable)
@@ -100,39 +100,7 @@ if is_yes "${IPV6_NETWORKING}" && is_yes "${IPV6_DISABLE_AUTOCONF}"; then
 fi
 
 if is_wireless_device "${DEVICE}"; then
-    [ -z "${WLAN_NICKNAME}" ] && WLAN_NICKNAME="$(hostname -f)"
-
-    # wlan mode needs to be first
-    [ -n "${WLAN_MODE}" ] && iwconfig ${DEVICE} mode ${WLAN_MODE}
-    iwconfig ${DEVICE} nickname ${WLAN_NICKNAME}
-    [ -n "${WLAN_ESSID}" ] && iwconfig ${DEVICE} essid ${WLAN_ESSID}
-    [ -n "${WLAN_NWID}" ] && iwconfig ${DEVICE} nwid ${WLAN_NWID}
-    if [ -n "${WLAN_FREQ}" -a "${WLAN_MODE}" != "Managed" ] ; then
-       iwconfig ${DEVICE} freq ${WLAN_FREQ}
-    elif [ -n "${WLAN_CHANNEL}" -a "${WLAN_MODE}" != "Managed" ]; then
-       iwconfig ${DEVICE} channel ${WLAN_CHANNEL}
-    fi
-    [ -n "${WLAN_SENS}" ] && iwconfig ${DEVICE} sens ${WLAN_SENS}
-    [ -n "${WLAN_AP}" ] && iwconfig ${DEVICE} ap ${WLAN_AP}
-    [ -n "${WLAN_BITRATE}" ] && iwconfig ${DEVICE} rate ${WLAN_BITRATE}
-    [ -n "${WLAN_RTS_THRESHOLD}" ] && iwconfig ${DEVICE} rts ${WLAN_RTS_THRESHOLD}
-    [ -n "${WLAN_FRAGMENTATION_THRESHOLD}" ] && iwconfig ${DEVICE} frag ${WLAN_FRAGMENTATION_THRESHOLD}
-    if [ -n "${WLAN_KEY}" ]; then
-       iwconfig ${DEVICE} key ${WLAN_KEY}
-       [ -n "${WLAN_ENCRYPTION}" ] && iwconfig ${DEVICE} key ${WLAN_ENCRYPTION}
-    fi
-    if is_no "${WLAN_ENCRYPTION}"; then
-       iwconfig ${DEVICE} key off
-    fi
-    [ -n "${WLAN_POWER}" ] && iwconfig ${DEVICE} power ${WLAN_POWER}
-    [ -n "${WLAN_TXPOWER}" ] && iwconfig ${DEVICE} txpower ${WLAN_TXPOWER}
-    [ -n "${WLAN_RETRY}" ] && iwconfig ${DEVICE} retry ${WLAN_RETRY}
-    if is_yes "${WLAN_COMMIT}"; then
-       iwconfig ${DEVICE} commit
-    fi
-    [ -n "${WLAN_NWID}" ] && iwconfig ${DEVICE} nwid ${WLAN_NWID}
-    # essid should be last due to netowork rescanning by wlan devices
-    [ -n "${WLAN_ESSID}" ] && iwconfig ${DEVICE} essid ${WLAN_ESSID}
+    wireless_param ${DEVICE}
 fi
        
 if [ "$HANDLING" = "2" ]; then
index 9d3180f444e1be54aad440f924573dff16155cbf..94e34b841ef7183117f3f89be5f9902be0797ec3 100755 (executable)
@@ -49,6 +49,13 @@ for device in $BRIDGE_DEVS; do
        ip addr flush dev ${device} 2>&1 | grep -v "Nothing to flush"
 done
 
+# set wireless parameters
+for device in $BRIDGE_DEVS; do
+        if is_wireless_device "${device}"; then
+            wireless_param "${device}" "br"
+        fi
+done
+
 brctl addbr ${DEVICE}
 
 # add interfaces to bridge
This page took 0.173409 seconds and 4 git commands to generate.