blob: ca4778b7df0c20b9550ff925b6de611c3fbfb9ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#!/bin/bash
# Copyright (c) 2005-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Contributed by Roy Marples (uberlord@gentoo.org)
interface="${1##*/dhcpcd-}"
interface="${interface%%.info}"
if [[ $2 != "up" && $2 != "new" ]] ; then
action="down"
else
action="up"
fi
[[ ${RC_GOT_FUNCTIONS} != "yes" ]] && source /sbin/functions.sh
RC_QUIET_STDOUT="yes"
source "${svclib}/net.modules.d/helpers.d/module-loader"
# Map MAC address variables to interface variables
macnet_pre_start "${interface}"
# Map wireless ESSID variables to interface variables
if [[ -n ${wireless_module} ]] ; then
if wireless_exists "${interface}" ; then
essidnet_pre_start "${interface}"
fi
fi
# Add any search paths if we have any defined
ifvar="$(bash_variable "${interface}")"
if [[ ${action} == "up" ]] ; then
d="dhcp_${ifvar}"
d=" ${!d} "
[[ ${d} == " " ]] && d=" ${dhcp} "
resolv="${statedir}/${interface}/resolv.conf"
if [[ ${d} != *" nodns "* ]] ; then
search="dns_search_${ifvar}"
if [[ -n ${!search} ]] ; then
tmp="${resolv}.$$"
egrep -v "^[ \t]*(search|domain)[ \t]*" "${resolv}" > "${tmp}"
echo "search ${!search}" >> "${tmp}"
mv "${tmp}" "${resolv}"
fi
fi
system_dns_extra "${interface}" "${resolv}"
fi
# As we override the -c option, we need to call the specified script ourself
opts="dhcpcd_${ifvar}"
exe="${!opts##* -c }"
if [[ -n ${exe} && ${exe} != "${!opts}" ]] ; then
exe="${exe%% *}"
else
exe="/etc/dhcpc/dhcpcd.exe"
fi
[[ -x ${exe} ]] && ( ${exe} "$@" 1>/dev/null )
source "${svclib}/net.modules.d/helpers.d/dhcp-state"
# vim: ts=4 :
|