diff options
Diffstat (limited to 'net-scripts/net.modules.d/ifconfig')
-rw-r--r-- | net-scripts/net.modules.d/ifconfig | 49 |
1 files changed, 8 insertions, 41 deletions
diff --git a/net-scripts/net.modules.d/ifconfig b/net-scripts/net.modules.d/ifconfig index 48a65fb..2f96c29 100644 --- a/net-scripts/net.modules.d/ifconfig +++ b/net-scripts/net.modules.d/ifconfig @@ -22,7 +22,9 @@ route() { # # Sets up the dependancies for the module ifconfig_depend() { - after macnet wireless + provide interface + variables config routes fallback metric ifconfig \ + ifconfig_fallback routes inet6 iface alias broadcast netmask } # bool ifconfig_check_installed(void) @@ -34,29 +36,6 @@ ifconfig_check_installed() { return 1 } -# char* ifconfig_provides(void) -# -# Returns a string to change module definition for starting up -ifconfig_provides() { - echo "interface" -} - -# char* ifconfig_module(void) -# -# Returns the module name -# This is needed by dhclient as we run different scripts -# based on the interface -ifconfig_module() { - echo "ifconfig" -} - -# bool ifconfig_check_depends(void) -# -# Checks to see if we have the needed functions -ifconfig_check_depends() { - return 0 -} - # bool ifconfig_exists(char *interface, bool report) # # Returns 1 if the interface exists, otherwise 0 @@ -190,18 +169,6 @@ ifconfig_del_addresses() { return 0 } -# char* ifconfig_get_vars(char *interface) -# -# Returns a string spaced with possible user set -# configuration variables -ifconfig_get_vars() { - echo "config_$1 routes_$1 fallback_$1 metric_$1 ifconfig_$1 \ - ifconfig_fallback_$1 routes_$1 inet6_$1 iface_$1 alias_$1 \ - broadcast_$1 netmask_$1" - # The depreciated gateway var has to be handled by - # each module if needed -} - # bool ifconfig_get_old_config(char *iface) # # Returns config and config_fallback for the given interface @@ -352,9 +319,9 @@ ifconfig_post_start() { # # Adds the given address to the interface ifconfig_add_address() { - local iface="$1" i=0 r e + local iface="$1" i=0 r e real_iface=$(interface_device "$1") - ifconfig_exists "${iface}" true || return 1 + ifconfig_exists "${real_iface}" true || return 1 # Extract the config local -a config=( "$@" ) @@ -390,18 +357,18 @@ ifconfig_add_address() { fi # Ensure that the interface is up so we can add IPv6 addresses - interface_up "${iface}" + interface_up "${real_iface}" # Some kernels like to apply lo with an address when they are brought up if [[ ${iface} == "lo" && ${config[@]} == "127.0.0.1 netmask 255.0.0.0 broadcast 127.255.255.255" ]]; then ifconfig "${iface}" 0.0.0.0 fi - + ifconfig "${iface}" ${config[@]} r="$?" [[ ${r} != "0" ]] && return ${r} - local metric ifvar=$( bash_variable "${iface}" ) + local metric ifvar=$(bash_variable "${real_iface}") # Remove the newly added route and replace with our metric eval metric=\"\$\{metric_${ifvar}\}\" [[ ${metric} == "0" || ${RC_AUTO_INTERFACE} != "yes" ]] && return ${r} |