diff options
Diffstat (limited to 'net-scripts/net.modules.d/netplugd')
-rw-r--r-- | net-scripts/net.modules.d/netplugd | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/net-scripts/net.modules.d/netplugd b/net-scripts/net.modules.d/netplugd index 2307a17..966b5da 100644 --- a/net-scripts/net.modules.d/netplugd +++ b/net-scripts/net.modules.d/netplugd @@ -4,19 +4,14 @@ # Contributed by Roy Marples (uberlord@gentoo.org) -# char* netplugd_provides(void) -# -# Returns a string to change module definition for starting up -netplugd_provides() { - echo "plug" -} - # void netplugd_depend(void) # # Sets up the dependancies for the module netplugd_depend() { - after macnet + after macnet rename before interface + provide plug + functions interface_exists interface_get_mac_address } # bool netplugd_check_installed(void) @@ -30,21 +25,6 @@ netplugd_check_installed() { return 0 } -# bool netplugd_check_depends(void) -# -# Checks to see if we have the needed functions -netplugd_check_depends() { - local f - - for f in interface_exists interface_get_mac_address ; do - [[ $( type -t "${f}" ) == "function" ]] && continue - eerror "netplugd: missing required function ${f}\n" - return 1 - done - - return 0 -} - # bool netplugd_pre_start(char *interface) # # Start netplug on an interface @@ -66,7 +46,7 @@ netplugd_pre_start() { fi # We don't work on bridges - if [[ $(type -t bridge_exists) == "function" ]]; then + if is_function bridge_exists ; then if bridge_exists "${iface}"; then veinfo "netplug does not work on bridges" return 0 @@ -74,7 +54,7 @@ netplugd_pre_start() { fi # We don't work on tun/tap interfaces - if [[ $(type -t tuntap_exists) == "function" ]]; then + if is_function tuntap_exists ; then if tuntap_exists "${iface}"; then veinfo "netplug does not work on tun/tap interfaces" return 0 @@ -82,7 +62,7 @@ netplugd_pre_start() { fi # We don't work on wirelesss interfaces - if [[ $(type -t wireless_check_extensions) == "function" ]]; then + if is_function wireless_check_extensions ; then if wireless_check_extensions "${iface}"; then veinfo "netplug does not work on wireless interfaces" return 0 @@ -131,11 +111,11 @@ netplugd_pre_start() { exit 0 } -# bool netplugd_post_stop(char *iface) +# bool netplugd_stop(char *iface) # # Stops netplug on an interface # Returns 0 (true) when successful, non-zero otherwise -netplugd_post_stop() { +netplugd_stop() { ${IN_BACKGROUND} && return 0 local iface="$1" local pidfile="/var/run/netplugd.${iface}.pid" |