diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2013-03-18 18:29:36 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2013-08-13 16:33:41 -0500 |
commit | 838c9efb36b3b058c5a5b9d0e8c6d4d4789a44b9 (patch) | |
tree | 4d30e9357d1f666ea37186b8a95dbe83c86b4dc8 /net/dhclient.sh | |
parent | b2f8ac9382d5dad70181ef803a37f43896f5cb91 (diff) |
Remove gentoo's net.* scripts
It has been determined that it will be best for gentoo's net.* scripts
to be in a separate package to allow independent development.
This package will be called netifrc and maintained by Gentoo.
Diffstat (limited to 'net/dhclient.sh')
-rw-r--r-- | net/dhclient.sh | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/net/dhclient.sh b/net/dhclient.sh deleted file mode 100644 index 8c100dd4..00000000 --- a/net/dhclient.sh +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright (c) 2007-2008 Roy Marples <roy@marples.name> -# Released under the 2-clause BSD license. - -dhclient_depend() -{ - after interface - program start /sbin/dhclient - provide dhcp -} - -_config_vars="$_config_vars dhcp dhcpcd" - -dhclient_start() -{ - local args= opt= opts= pidfile="/var/run/dhclient-${IFACE}.pid" - local sendhost=true dconf= - - # Get our options - # These options only work in Gentoo, and maybe RedHat - eval args=\$dhclient_${IFVAR} - eval opts=\$dhcp_${IFVAR} - [ -z "${opts}" ] && opts=${dhcp} - - for opt in ${opts}; do - case "${opt}" in - nodns) args="${args} -e PEER_DNS=no";; - nontp) args="${args} -e PEER_NTP=no";; - nogateway) args="${args} -e PEER_ROUTERS=no";; - nosendhost) sendhost=false;; - esac - done - - # Add our route metric - [ "${metric:-0}" != "0" ] && args="${args} -e IF_METRIC=${metric}" - - if ${sendhost}; then - local hname="$(hostname)" - if [ "${hname}" != "(none)" -a "${hname}" != "localhost" ]; then - dhconf="${dhconf} interface \"${IFACE}\" {" - dhconf="${dhconf} send host-name \"${hname}\";" - dhconf="${dhconf}}" - fi - fi - - # Bring up DHCP for this interface - ebegin "Running dhclient" - echo "${dhconf}" | start-stop-daemon --start --exec /sbin/dhclient \ - --pidfile "${pidfile}" \ - -- ${args} -q -1 -pf "${pidfile}" "${IFACE}" - eend $? || return 1 - - _show_address - return 0 -} - -dhclient_stop() -{ - local pidfile="/var/run/dhclient-${IFACE}.pid" opts= - [ ! -f "${pidfile}" ] && return 0 - - # Get our options - if [ -x /sbin/dhclient ]; then - eval opts=\$dhcp_${IFVAR} - [ -z "${opts}" ] && opts=${dhcp} - fi - - ebegin "Stopping dhclient on ${IFACE}" - case " ${opts} " in - *" release "*) dhclient -q -r -pf "${pidfile}" "${IFACE}";; - *) - start-stop-daemon --stop --quiet \ - --exec /sbin/dhclient --pidfile "${pidfile}" - ;; - esac - eend $? -} |