aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-05-10 12:29:49 +0000
committerRoy Marples <roy@marples.name>2008-05-10 12:29:49 +0000
commit762dc3d197c9383f746547dde2ad81543861166f (patch)
tree3335faac4361a1aa66f4570c1b72fc0d2a3eee4c /net
parent30fe99dead7d2234607df6eb476fec6e03b3a559 (diff)
Work with dhcpcd-4 style options.
Diffstat (limited to 'net')
-rw-r--r--net/dhcpcd.sh31
1 files changed, 26 insertions, 5 deletions
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