/[vps]/baselayout-vserver/trunk/net-scripts/net.modules.d/essidnet
Gentoo

Contents of /baselayout-vserver/trunk/net-scripts/net.modules.d/essidnet

Parent Directory Parent Directory | Revision Log Revision Log


Revision 236 - (show annotations) (download)
Tue Feb 14 13:00:44 2006 UTC (8 years, 5 months ago) by phreak
File size: 1525 byte(s)
Merging r1881
1 #!/bin/bash
2 # Copyright (c) 2004-2006 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 # Contributed by Roy Marples (uberlord@gentoo.org)
6 # Many thanks to all the people in the Gentoo forums for their ideas and
7 # motivation for me to make this and keep on improving it
8
9 # Load our config if it exists
10 [[ -f $(add_suffix "/etc/conf.d/wireless" ) ]] \
11 && source $(add_suffix "/etc/conf.d/wireless" )
12
13 # void essidnet_depend(void)
14 #
15 # Sets up the dependancies for the module
16 essidnet_depend() {
17 before interface system
18 after wireless
19 installed wireless
20 functions wireless_exists wireless_get_essid wireless_get_ap_mac_address
21 }
22
23 # bool essidnet_start(char *iface)
24 #
25 # All interfaces and module scripts can depend on the variables function
26 # which returns a space seperated list of user configuration variables
27 # We can override each variable here from a given ESSID or the MAC
28 # of the AP connected to. MAC configuration takes precedence
29 # Always returns 0
30 essidnet_pre_start() {
31 local iface="$1"
32
33 wireless_exists "${iface}" || return 0
34
35 local mac=$( wireless_get_ap_mac_address "${iface}" )
36 local ESSID=$( wireless_get_essid "${iface}" )
37 local essid=$( bash_variable ${ESSID} )
38 mac="${mac//:/}"
39
40 vebegin "Configuring ${iface} for ESSID \"${ESSID//\\\\/\\\\}\"" 2>/dev/null
41 configure_variables "${iface}" "${essid}" "${mac}"
42
43 # Backwards compat for old gateway var
44 x="gateway_${essid}"
45 [[ -n ${!x} ]] && gateway="${iface}/${!x}"
46
47 veend 0 2>/dev/null
48 return 0
49 }
50
51 # vim:ts=4

  ViewVC Help
Powered by ViewVC 1.1.20