aboutsummaryrefslogtreecommitdiff
path: root/net/netplugd.sh
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2013-03-18 18:29:36 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2013-08-13 16:33:41 -0500
commit838c9efb36b3b058c5a5b9d0e8c6d4d4789a44b9 (patch)
tree4d30e9357d1f666ea37186b8a95dbe83c86b4dc8 /net/netplugd.sh
parentb2f8ac9382d5dad70181ef803a37f43896f5cb91 (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/netplugd.sh')
-rw-r--r--net/netplugd.sh96
1 files changed, 0 insertions, 96 deletions
diff --git a/net/netplugd.sh b/net/netplugd.sh
deleted file mode 100644
index f43a5e64..00000000
--- a/net/netplugd.sh
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
-# Released under the 2-clause BSD license.
-
-_config_vars="$_config_vars plug_timeout"
-
-netplugd_depend()
-{
- program start /sbin/netplugd
- after macnet rename
- before interface
- provide plug
-
- # Prefer ifplugd
- before ifplugd
-}
-
-netplugd_pre_start()
-{
- local pidfile="/var/run/netplugd-${IFACE}.pid" timeout=
-
- # We don't start netplug if we're being called from the background
- yesno ${IN_BACKGROUND} && return 0
-
- _exists || return 0
-
- # We need a valid MAC address
- # It's a basic test to ensure it's not a virtual interface
- if ! _get_mac_address >/dev/null 2>&1; then
- vewarn "netplug only works on interfaces with a valid MAC address"
- return 0
- fi
-
- # We don't work on bonded, bridges, tun/tap, vlan or wireless
- for f in bond bridge tuntap vlan wireless; do
- if type "_is_${f}" >/dev/null 2>&1; then
- if _is_${f}; then
- veinfo "netplug does not work with" "${f}"
- return 0
- fi
- fi
- done
-
- ebegin "Starting netplug on" "${IFACE}"
-
- # Mark the us as inactive so netplug can restart us
- mark_service_inactive
-
- # Start netplug
- start-stop-daemon --start --exec /sbin/netplugd \
- --pidfile "${pidfile}" \
- -- -i "${IFACE}" -P -p "${pidfile}" -c /dev/null
- eend "$?" || return 1
-
- eindent
-
- # IFACE-specific, then global, then default
- eval timeout=\$plug_timeout_${IFVAR}
- [ -z "${timeout}" ] && timeout=$plug_timeout
- [ -z "${timeout}" ] && timeout=-1
- if [ ${timeout} -eq 0 ]; then
- ewarn "WARNING: infinite timeout set for ${IFACE} to come up"
- elif [ ${timeout} -lt 0 ]; then
- einfo "Backgrounding ..."
- exit 1
- fi
-
- veinfo "Waiting for ${IFACE} to be marked as started"
-
- local i=0
- while true; do
- if service_started; then
- _show_address
- exit 0
- fi
- sleep 1
- [ ${timeout} -eq 0 ] && continue
- : $(( i += 1 ))
- [ ${i} -ge ${timeout} ] && break
- done
-
- eend 1 "Failed to configure ${IFACE} in the background"
- exit 1
-}
-
-netplugd_stop()
-{
- yesno ${IN_BACKGROUND} && return 0
-
- local pidfile="/var/run/netplugd-${IFACE}.pid"
- [ ! -e "${pidfile}" ] && return 0
-
- ebegin "Stopping netplug on" "${IFACE}"
- start-stop-daemon --stop --quiet --exec /sbin/netplugd \
- --pidfile "${pidfile}"
- eend $?
-}