aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-05-18 20:09:10 +0000
committerRoy Marples <roy@marples.name>2007-05-18 20:09:10 +0000
commit49347d6f77532f4a03849f650d2d915d7805948f (patch)
tree9d132ce8a28b723202f29244d35460032ad93689 /sh
parent237a66b05cf1e33bf680802d9032cf0eb0981df8 (diff)
Be more resilient when the nettree is invalid
Diffstat (limited to 'sh')
-rwxr-xr-xsh/net.sh15
1 files changed, 9 insertions, 6 deletions
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))