/[baselayout]/trunk/net-scripts/net.modules.d/helpers.d/dhcp-state
Gentoo

Diff of /trunk/net-scripts/net.modules.d/helpers.d/dhcp-state

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1301 Revision 1302
1#!/bin/bash 1#!/bin/bash
2# Copyright (c) 2004-2005 Gentoo Foundation 2# Copyright (c) 2005 Gentoo Foundation
3# Distributed under the terms of the GNU General Public License v2 3# Distributed under the terms of the GNU General Public License v2
4 4
5# Contributed by Roy Marples (uberlord@gentoo.org) 5# Contributed by Roy Marples (uberlord@gentoo.org)
6 6
7. /lib/rcscripts/net.modules.d/helpers.d/module-loader 7MODULES_DIR="/lib/rcscripts/net.modules.d"
8. /lib/rcscripts/sh/rc-services.sh
9. "${MODULES_DIR}/helpers.d/functions"
10conf=$(add_suffix "/etc/conf.d/net")
11[[ -e ${conf} ]] && source "${conf}"
8 12
9service="net.${interface}" 13service="net.${interface}"
10 14
11if [[ ${action} != "up" ]]; then 15if [[ ${action} != "up" ]]; then
12 if service_starting "${service}" || service_started "${service}" ; then 16 if service_starting "${service}" || service_started "${service}" ; then
13 mark_service_inactive "${service}" 17 mark_service_inactive "${service}"
14 fi 18 fi
15 remove_state "${interface}" false 19 remove_state "${interface}" false
16 if [[ ${RC_AUTO_INTERFACE} == "yes" ]]; then 20else
17 best_interface=$( select_best_interface ) 21 ! service_stopping "${service}" && mark_service_started "${service}"
18 apply_state "${best_interface}"
19 fi
20 exit 0
21fi 22fi
22 23
23# Map MAC address variables to interface variables 24if [[ ${RC_AUTO_INTERFACE} == "yes" ]]; then
24macnet_pre_start "${interface}" 1>/dev/null 25 best_interface=$( select_best_interface )
25 26 apply_state "${best_interface}"
26# Map wireless ESSID variables to interface variables
27if [[ -n ${wireless_module} ]]; then
28 if wireless_check_extensions "${interface}" ; then
29 essidnet_pre_start "${interface}" 1>/dev/null
30 fi
31fi 27fi
32
33# Add any search domains if we have any defined
34ifvar=$( bash_variable "${interface}" )
35eval d=\" \$\{dhcp_${ifvar}\} \"
36[[ ${d} == " " ]] && d=" ${dhcp} "
37
38if [[ ${d} != *" nodns "* ]]; then
39 eval search=\"\$\{dns_search_domains_${ifvar}\}\"
40 if [[ -n ${search} ]]; then
41 resolv="${statedir}/${interface}/resolv.conf"
42 tmp="${revolv}.$$"
43 egrep -v "^[ \t]*search" "${resolv}" > "${tmp}"
44 domain=$( sed -n -e 's/^[ \t]*domain[ \t]*\(.*\)[ \t]*.*/\1/p' ${tmp} )
45 echo "search ${domain} ${search}" >> "${tmp}"
46 mv "${tmp}" "${resolv}"
47 fi
48fi
49
50! service_stopping "${service}" && mark_service_started "${service}"
51
52[[ ${RC_AUTO_INTERFACE} == "yes" ]] && interface=$( select_best_interface )
53apply_state "${interface}"

Legend:
Removed from v.1301  
changed lines
  Added in v.1302

  ViewVC Help
Powered by ViewVC 1.1.20