Lines 66-92
dhcpcd_start() {
Link Here
|
66 |
interface_exists "${iface}" true || return 1 |
66 |
interface_exists "${iface}" true || return 1 |
67 |
|
67 |
|
68 |
# Get our options |
68 |
# Get our options |
69 |
opts="dhcpcd_${ifvar}" |
69 |
eval opts=\$dhcp_${ifvar} |
70 |
opts="${dhcpcd} ${!opts}" |
70 |
[ -z "${opts}" ] && opts=${dhcp} |
71 |
|
71 |
|
72 |
# Map some generic options to dhcpcd |
72 |
case "$(dhcpcd --version)" in |
73 |
d="dhcp_${ifvar}" |
73 |
"dhcpcd "[123]*) new=false;; |
74 |
d=" ${!d} " |
74 |
*) new=true;; |
75 |
[[ ${d} == " " ]] && d=" ${dhcp} " |
75 |
esac |
76 |
[[ ${d} == *" nodns "* ]] && opts="${opts} -R" |
76 |
|
77 |
[[ ${d} == *" nontp "* ]] && opts="${opts} -N" |
77 |
# Map some generic options to dhcpcd |
78 |
[[ ${d} == *" nonis "* ]] && opts="${opts} -Y" |
78 |
for opt in ${opts}; do |
79 |
[[ ${d} == *" nogateway "* ]] && opts="${opts} -G" |
79 |
case "${opt}" in |
80 |
if [[ ${d} == *" nosendhost "* ]] ; then |
80 |
nodns) |
81 |
opts="${opts} -h ''" |
81 |
if ${new}; then |
82 |
else |
82 |
opts="${opts} -C resolv.conf" |
83 |
# We transmit the hostname by default |
83 |
else |
84 |
if [[ " ${opts} " != *" -h "* ]]; then |
84 |
opts="${opts} -R" |
85 |
local hname=$(hostname) |
85 |
fi |
86 |
[[ -n ${hname} && ${hname} != "(none)" && ${hname} != "localhost" ]] \ |
86 |
;; |
87 |
&& opts="-h \"${hname}\" ${opts}" |
87 |
nontp) |
88 |
fi |
88 |
if ${new}; then |
89 |
fi |
89 |
opts="${opts} -C ntp.conf" |
|
|
90 |
else |
91 |
opts="${opts} -N" |
92 |
fi |
93 |
;; |
94 |
nonis) |
95 |
if ${new}; then |
96 |
opts="${opts} -C yp.conf" |
97 |
else |
98 |
opts="${opts} -Y" |
99 |
fi |
100 |
;; |
101 |
nogateway) opts="${opts} -G";; |
102 |
nosendhost) opts="${opts} -h ''"; |
103 |
esac |
104 |
done |
90 |
|
105 |
|
91 |
# Add our route metric |
106 |
# Add our route metric |
92 |
metric="metric_${ifvar}" |
107 |
metric="metric_${ifvar}" |