/[baselayout]/trunk/net/dhcpcd.sh
Gentoo

Contents of /trunk/net/dhcpcd.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2672 - (show annotations) (download) (as text)
Tue May 1 09:37:14 2007 UTC (7 years, 2 months ago) by uberlord
File MIME type: text/x-sh
File size: 1437 byte(s)
s-s-d with dhcpcd still has some issues, revert until a fix for dhcpcd is made
1 # Copyright 2004-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 dhcpcd_depend() {
5 after interface
6 program start /sbin/dhcpcd
7 provide dhcp
8
9 # We prefer dhcpcd over the others
10 after dhclient pump udhcpc
11 }
12
13 _config_vars="$_config_vars dhcp dhcpcd"
14
15 dhcpcd_start() {
16 local args= opt= opts= pidfile="/var/run/dhcpcd-${IFACE}.pid"
17
18 eval args=\$dhcpcd_${IFVAR}
19
20 # Get our options
21 eval opts=\$dhcp_${IFVAR}
22 [ -z "${opts}" ] && opts=${dhcp}
23
24 # Map some generic options to dhcpcd
25 for opt in ${opts} ; do
26 case "${opt}" in
27 nodns) args="${args} -R" ;;
28 nontp) args="${args} -N" ;;
29 nonis) args="${args} -Y" ;;
30 nogateway) args="${args} -G" ;;
31 nosendhost) args="${args} -h ''";
32 esac
33 done
34
35 # Add our route metric
36 [ "${metric:-0}" != "0" ] && args="${args} -m ${metric}"
37
38 # Bring up DHCP for this interface
39 ebegin "Running dhcpcd"
40
41 eval /sbin/dhcpcd "${args}" "${IFACE}"
42 eend $? || return 1
43
44 _show_address
45 return 0
46 }
47
48 dhcpcd_stop() {
49 local pidfile="/var/run/dhcpcd-${IFACE}.pid" opts=
50 [ ! -f "${pidfile}" ] && return 0
51
52 # Get our options
53 if [ -x /sbin/dhcpcd ] ; then
54 eval opts=\$dhcp_${IFVAR}
55 [ -z "${opts}" ] && opts=${dhcp}
56 fi
57
58 ebegin "Stopping dhcpcd on ${IFACE}"
59 case " ${opts} " in
60 *" release "*) dhcpcd -k "${IFACE}" ;;
61 *)
62 start-stop-daemon --stop --quiet \
63 --exec /sbin/dhcpcd --pidfile "${pidfile}"
64 ;;
65 esac
66 eend $?
67 }
68
69 # vim: set ts=4 :

  ViewVC Help
Powered by ViewVC 1.1.20