From 49347d6f77532f4a03849f650d2d915d7805948f Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 18 May 2007 20:09:10 +0000 Subject: Be more resilient when the nettree is invalid --- sh/net.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'sh') diff --git a/sh/net.sh b/sh/net.sh index b9f3ff7c..38df7db2 100755 --- a/sh/net.sh +++ b/sh/net.sh @@ -118,8 +118,8 @@ _show_address() { # Basically sorts our modules into order and saves the list _gen_module_list() { - local x= f= - if [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt "${MODULESDIR}" ] ; then + local x= f= force=$1 + if ! ${force} && [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt "${MODULESDIR}" ] ; then local update=false for x in "${MODULESDIR}"/* ; do [ -e "${x}" ] || continue @@ -230,18 +230,21 @@ _gen_module_list() { } _load_modules() { - # Ensure our list is up to date - _gen_module_list - local starting=$1 mymods= + # Ensure our list is up to date + _gen_module_list false + if ! . "${MODULESLIST}" ; then + _gen_module_list true + . "${MODULESLIST}" + fi + MODULES= if [ "${IFACE}" != "lo" -a "${IFACE}" != "lo0" ] ; then eval mymods=\$modules_${IFVAR} [ -z "${mymods}" ] && mymods=${modules} fi - . "${MODULESLIST}" local i=-1 x= mod= f= provides= while true ; do i=$((${i} + 1)) -- cgit v1.2.3