From 762dc3d197c9383f746547dde2ad81543861166f Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sat, 10 May 2008 12:29:49 +0000 Subject: Work with dhcpcd-4 style options. --- net/dhcpcd.sh | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'net') diff --git a/net/dhcpcd.sh b/net/dhcpcd.sh index c732ed91..79c90156 100644 --- a/net/dhcpcd.sh +++ b/net/dhcpcd.sh @@ -15,20 +15,41 @@ _config_vars="$_config_vars dhcp dhcpcd" 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} # Get our options eval opts=\$dhcp_${IFVAR} [ -z "${opts}" ] && opts=${dhcp} + case "$(dhcpcd --version)" in + "dhcpcd "[123]*) new=false;; + esac + # Map some generic options to dhcpcd for opt in ${opts}; do case "${opt}" in - nodns) args="${args} -R";; - nontp) args="${args} -N";; - nonis) args="${args} -Y";; + nodns) + if ${new}; then + 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";; nosendhost) args="${args} -h ''"; esac -- cgit v1.2.3