Having two files which are used more or less at the same time isn't
that easy to handle and read. Instead, move the contents of netroot.info
to root.info and only use root.info. This is cleaner and makes debugging
easier.
if [ "$netroot" = "$root" ]; then
unset root
fi
-
-if [ "${netroot+set}" = "set" ]; then
- eval "echo netroot='$netroot'" > /tmp/netroot.info
-fi
# bail immediately if the interface is already up
# or we don't need the network
[ -f "/tmp/net.$netif.up" ] && exit 0
-[ ! -f /tmp/netroot.info ] && exit 0
+[ -f "/tmp/root.info" ] || exit 0
+. /tmp/root.info
+[ -z "$netroot" ] && exit 0
# loopback is always handled the same way
[ "$netif" = "lo" ] && {
# then no point in looking further
#
[ -e /tmp/netroot.done ] && exit 0
-[ -s /tmp/netroot.info -a -s /tmp/root.info ] || exit 0
+[ -f /tmp/root.info ] || exit 1
# Pick up our config from the command line; we may already know the
# handler to run
#
. /tmp/root.info
-. /tmp/netroot.info
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
+# Don't continue if netroot isn't needed
+[ -z "$netroot" ] && exit 0
+
# Now, let the installed network root handlers figure this out
#
source_all netroot
echo "root='$root'"
echo "rflags='$rflags'"
echo "fstype='$fstype'"
+ echo "netroot='$netroot'"
echo "NEWROOT='$NEWROOT'"
} > /tmp/root.info