diff options
author | Roy Marples <roy@marples.name> | 2007-05-18 20:09:10 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-05-18 20:09:10 +0000 |
commit | 49347d6f77532f4a03849f650d2d915d7805948f (patch) | |
tree | 9d132ce8a28b723202f29244d35460032ad93689 /sh | |
parent | 237a66b05cf1e33bf680802d9032cf0eb0981df8 (diff) |
Be more resilient when the nettree is invalid
Diffstat (limited to 'sh')
-rwxr-xr-x | sh/net.sh | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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)) |