diff options
Diffstat (limited to 'init.d/net.lo.in')
-rw-r--r-- | init.d/net.lo.in | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/init.d/net.lo.in b/init.d/net.lo.in index a8e19dd..72a5427 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -227,6 +227,34 @@ _show_address() einfo "received address $(_get_inet_address "${IFACE}")" } +# Allow custom error handling behavior to be set by the user. +# Known used combinations, with defaults +# errh_IFVAR_address_EEXIST=warn +# errh_IFVAR_route_EEXIST=warn +_get_errorhandler_behavior() { + IFVAR="$1" + object="$2" + error="$3" + fallback="$4" + value= + for key in \ + "errh_${IFVAR}_${object}_${error}" \ + "errh_${IFVAR}_${object}_DEFAULT" \ + "errh_${IFVAR}_DEFAULT_${error}" \ + "errh_${IFVAR}_DEFAULT_DEFAULT" \ + "errh_DEFAULT_${object}_${error}" \ + "errh_DEFAULT_${object}_DEFAULT" \ + "errh_DEFAULT_DEFAULT_${error}" \ + "errh_DEFAULT_DEFAULT_DEFAULT" \ + "errh" \ + "fallback" ; do + eval value="\${${key}}" + if [ -n "$value" ]; then + echo "$value" && break + fi + done +} + # Basically sorts our modules into order and saves the list _gen_module_list() { @@ -665,7 +693,7 @@ start() return 1 fi - local hideFirstroute=false first=true routes= + local first=true routes= if ${fallback}; then routes="$(_get_array "fallback_routes_${IFVAR}")" fi @@ -676,7 +704,6 @@ start() if [ "${config_0}" != "null" ]; then routes="127.0.0.0/8 via 127.0.0.1 ${routes}" - hideFirstroute=true fi fi @@ -708,12 +735,7 @@ ${routes}" *:*/*) cmd="-net ${cmd}";; *) cmd="-host ${cmd}";; esac - if ${hideFirstroute}; then - _add_route ${fam} ${cmd} >/dev/null 2>&1 - hideFirstroute=false - else - _add_route ${fam} ${cmd} >/dev/null - fi + _add_route ${fam} ${cmd} eend $? eoutdent done @@ -816,3 +838,5 @@ stop() return 0 } + +# vim:filetype=gentoo-init-d: |