]> git.pld-linux.org Git - packages/rc-scripts.git/blame - rc-scripts-wlan.patch
- and btw: rel 12.2
[packages/rc-scripts.git] / rc-scripts-wlan.patch
CommitLineData
6e3eeba4
AM
1diff -urN rc-scripts-0.3.1.org/rc.d/init.d/functions.network rc-scripts-0.3.1/rc.d/init.d/functions.network
2--- rc-scripts-0.3.1.org/rc.d/init.d/functions.network Wed Aug 7 19:51:25 2002
3+++ rc-scripts-0.3.1/rc.d/init.d/functions.network Wed Aug 7 20:06:10 2002
4@@ -361,6 +361,13 @@
5 fi
6 }
7
8+is_wireless_device () {
9+ if [ -x /sbin/iwconfig ]; then
10+ LC_ALL=C iwconfig "${1}" 2>&1 | grep -q "no wireless extensions" || return 0
11+ fi
12+ return 1
13+}
14+
15 #
16 # following function sets up routes not associated to any device
17 # eg. unreachable or blackhole routes
18diff -urN rc-scripts-0.3.1.org/sysconfig/network-scripts/ifup rc-scripts-0.3.1/sysconfig/network-scripts/ifup
19--- rc-scripts-0.3.1.org/sysconfig/network-scripts/ifup Wed Aug 7 19:51:25 2002
20+++ rc-scripts-0.3.1/sysconfig/network-scripts/ifup Wed Aug 7 19:53:10 2002
21@@ -104,6 +104,42 @@
22 if is_yes "${IPV6_NETWORKING}" && is_yes "${IPV6_DISABLE_AUTOCONF}"; then
23 run_cmd "Disabling IPv6 autoconfiguration" sysctl -w net.ipv6.conf.${DEVICE}=0
24 fi
25+
26+if is_wireless_device "${DEVICE}"; then
27+ [ -z "${WLAN_NICKNAME}" ] && WLAN_NICKNAME="$(hostname -f)"
28+
29+ # wlan mode needs to be first
30+ [ -n "${WLAN_MODE}" ] && iwconfig ${DEVICE} mode ${WLAN_MODE}
31+ iwconfig ${DEVICE} nickname ${WLAN_NICKNAME}
32+ [ -n "${WLAN_ESSID}" ] && iwconfig ${DEVICE} essid ${WLAN_ESSID}
33+ [ -n "${WLAN_NWID}" ] && iwconfig ${DEVICE} nwid ${WLAN_NWID}
34+ if [ -n "${WLAN_FREQ}" -a "${WLAN_MODE}" != "Managed" ] ; then
35+ iwconfig ${DEVICE} freq ${WLAN_FREQ}
36+ elif [ -n "${WLAN_CHANNEL}" -a "${WLAN_MODE}" != "Managed" ]; then
37+ iwconfig ${DEVICE} channel ${WLAN_CHANNEL}
38+ fi
39+ [ -n "${WLAN_SENS}" ] && iwconfig ${DEVICE} sens ${WLAN_SENS}
40+ [ -n "${WLAN_AP}" ] && iwconfig ${DEVICE} ap ${WLAN_AP}
41+ [ -n "${WLAN_BITRATE}" ] && iwconfig ${DEVICE} rate ${WLAN_BITRATE}
42+ [ -n "${WLAN_RTS_THRESHOLD}" ] && iwconfig ${DEVICE} rts ${WLAN_RTS_THRESHOLD}
43+ [ -n "${WLAN_FRAGMENTATION_THRESHOLD}" ] && iwconfig ${DEVICE} frag ${WLAN_FRAGMENTATION_THRESHOLD}
44+ if [ -n "${WLAN_KEY}" ]; then
45+ iwconfig ${DEVICE} key ${WLAN_KEY}
46+ [ -n "${WLAN_ENCRYPTION}" ] && iwconfig ${DEVICE} key ${WLAN_ENCRYPTION}
47+ fi
48+ if is_no "${WLAN_ENCRYPTION}"; then
49+ iwconfig ${DEVICE} key off
50+ fi
51+ [ -n "${WLAN_POWER}" ] && iwconfig ${DEVICE} ${WLAN_POWER}
52+ [ -n "${WLAN_TXPOWER}" ] && iwconfig ${DEVICE} ${WLAN_TXPOWER}
53+ [ -n "${WLAN_RETRY}" ] && iwconfig ${DEVICE} ${WLAN_RETRY}
54+ if is_yes "${WLAN_COMMIT}"; then
55+ iwconfig ${DEVICE} commit
56+ fi
57+ [ -n "${WLAN_NWID}" ] && iwconfig ${DEVICE} nwid ${WLAN_NWID}
58+ # essid should be last due to netowork rescanning by wlan devices
59+ [ -n "${WLAN_ESSID}" ] && iwconfig ${DEVICE} essid ${WLAN_ESSID}
60+fi
61
62 if [ "$HANDLING" = "2" ]; then
63 exit 0
This page took 0.038206 seconds and 4 git commands to generate.