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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 236 - (show annotations) (download)
Tue Feb 14 13:00:44 2006 UTC (9 years, 4 months ago) by phreak
File size: 1299 byte(s)
Merging r1881
1 #!/bin/bash
2 # Copyright (c) 2005 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 # void macnet_depend(void)
10 #
11 # Sets up the dependancies for the module
12 macnet_depend() {
13 before rename interface wireless
14 after macchanger
15 installed macchanger
16 functions interface_get_mac_address
17 }
18
19 # bool macnet_start(char *iface)
20 #
21 # All interfaces and module scripts can depend on the variables function
22 # which returns a space seperated list of user configuration variables
23 # We can override each variable here from a given MAC address of the interface
24 # Always returns 0
25 macnet_pre_start() {
26 local iface="$1"
27
28 interface_exists "${iface}" || return 0
29
30 # We need to bring the interface up for some interfaces, otherwise the MAC
31 # address isn't consistent - mainly wireless cards with firmware uploading.
32 interface_up "${iface}"
33
34 local mac=$( interface_get_mac_address "${iface}" )
35 [[ -z ${mac} ]] && return 0
36
37 vebegin "Configuring ${iface} for MAC address ${mac}" 2>/dev/null
38 mac="${mac//:/}"
39 configure_variables "${iface}" "${mac}"
40 veend 0 2>/dev/null
41
42 return 0
43 }
44
45 # vim:ts=4

  ViewVC Help
Powered by ViewVC 1.1.20