/[vps]/baselayout-vserver/trunk/lib/rcscripts/net.modules.d/helpers.d/module-loader
Gentoo

Contents of /baselayout-vserver/trunk/lib/rcscripts/net.modules.d/helpers.d/module-loader

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations) (download)
Sat Sep 3 16:10:27 2005 UTC (8 years, 11 months ago) by hollow
File size: 1283 byte(s)
import initial baselayout sources (1.12.0_pre8)
1 #!/bin/bash
2 # Copyright (c) 2004-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
7 [[ -z ${MODULES_DIR} ]] && MODULES_DIR="/lib/rcscripts/net.modules.d"
8 . "${MODULES_DIR}/system"
9 . /lib/rcscripts/sh/rc-services.sh
10 . "${MODULES_DIR}/helpers.d/functions"
11 conf=$(add_suffix "/etc/conf.d/net")
12 [[ -e ${conf} ]] && source "${conf}"
13
14 # Guess which interface module to load - we prefer iproute2
15 if [[ -x /sbin/ip ]]; then
16 interface_module="iproute2"
17 elif [[ -x /sbin/ifconfig ]]; then
18 interface_module="ifconfig"
19 else
20 echo "Can't find a known interface module" >&2
21 exit 1
22 fi
23
24 # iwconfig is the best bet for wireless - we use wpa_supplicant
25 # only if we need to
26 if [[ -x /sbin/iwconfig ]]; then
27 wireless_module="iwconfig"
28 elif [[ -x /sbin/wpa_supplicant \
29 && -S "/var/run/wpa_supplicant/${interface}" ]]; then
30 wireless_module="wpa_supplicant"
31 fi
32
33 MODULES=( "system" )
34
35 # Load our modules
36 . "${MODULES_DIR}/${interface_module}"
37 function_wrap "${interface_module}" interface
38 . "${MODULES_DIR}/macnet"
39 . "${MODULES_DIR}/system"
40
41 if [[ -n ${wireless_module} ]]; then
42 . "${MODULES_DIR}/${wireless_module}"
43 function_wrap "${wireless_module}" wireless
44 . "${MODULES_DIR}/essidnet"
45 fi
46
47 # vim:ts=4

  ViewVC Help
Powered by ViewVC 1.1.20