Work with dhcpcd-4 style options.
This commit is contained in:
parent
30fe99dead
commit
762dc3d197
@ -15,20 +15,41 @@ _config_vars="$_config_vars dhcp dhcpcd"
|
|||||||
|
|
||||||
dhcpcd_start()
|
dhcpcd_start()
|
||||||
{
|
{
|
||||||
local args= opt= opts= pidfile="/var/run/dhcpcd-${IFACE}.pid"
|
local args= opt= opts= pidfile="/var/run/dhcpcd-${IFACE}.pid" new=true
|
||||||
|
|
||||||
eval args=\$dhcpcd_${IFVAR}
|
eval args=\$dhcpcd_${IFVAR}
|
||||||
|
|
||||||
# Get our options
|
# Get our options
|
||||||
eval opts=\$dhcp_${IFVAR}
|
eval opts=\$dhcp_${IFVAR}
|
||||||
[ -z "${opts}" ] && opts=${dhcp}
|
[ -z "${opts}" ] && opts=${dhcp}
|
||||||
|
|
||||||
|
case "$(dhcpcd --version)" in
|
||||||
|
"dhcpcd "[123]*) new=false;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Map some generic options to dhcpcd
|
# Map some generic options to dhcpcd
|
||||||
for opt in ${opts}; do
|
for opt in ${opts}; do
|
||||||
case "${opt}" in
|
case "${opt}" in
|
||||||
nodns) args="${args} -R";;
|
nodns)
|
||||||
nontp) args="${args} -N";;
|
if ${new}; then
|
||||||
nonis) args="${args} -Y";;
|
args="${args} -O domain_name_servers,domain_name,domain_search"
|
||||||
|
else
|
||||||
|
args="${args} -R"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
nontp)
|
||||||
|
if ${new}; then
|
||||||
|
args="${args} -O ntp_servers"
|
||||||
|
else
|
||||||
|
args="${args} -N"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
nonis)
|
||||||
|
if ${new}; then
|
||||||
|
args="${args} -O nis_servers,nis_domain"
|
||||||
|
else
|
||||||
|
args="${args} -Y"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
nogateway) args="${args} -G";;
|
nogateway) args="${args} -G";;
|
||||||
nosendhost) args="${args} -h ''";
|
nosendhost) args="${args} -h ''";
|
||||||
esac
|
esac
|
||||||
|
Loading…
x
Reference in New Issue
Block a user