summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTom Grennan <tgrennan@io.vyatta.com>2007-12-14 13:10:21 -0800
committerTom Grennan <tgrennan@io.vyatta.com>2007-12-14 13:10:21 -0800
commitb484ad3193f65a790e6f534902252c98b7217884 (patch)
tree489ddbf1659ee282306af8da04cf81b687bff8c5 /scripts
parent5705741d4b523d0869d694ed320a333d3b87937d (diff)
downloadvyatta-cfg-system-b484ad3193f65a790e6f534902252c98b7217884.tar.gz
vyatta-cfg-system-b484ad3193f65a790e6f534902252c98b7217884.zip
test for config file missing interface or interface hwid
Diffstat (limited to 'scripts')
-rw-r--r--scripts/vyatta_net_name21
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/vyatta_net_name b/scripts/vyatta_net_name
index d93dd288..56d90f14 100644
--- a/scripts/vyatta_net_name
+++ b/scripts/vyatta_net_name
@@ -21,7 +21,8 @@
#
# **** End License ****
-debug=''
+debug=
+match=
attr_address=0:0:0:0:0:0
test -r /etc/default/vyatta && source /etc/default/vyatta
@@ -96,11 +97,25 @@ for name_hwid in ${cfg_net_hwid[@]} ; do
echo $name
exit 0
fi
+ [ "$name" == "$kname" ] && match=$name_hwid
done
+# have not found matching hwid in config, see if we can use kernel name
if [ -n "$kname" ] ; then
- echo $kname
- exit 0
+ # if interface missing entirely from config
+ # or it does not yet have a recorded hwid
+ # it is safe to use kernel name
+ if [[ -z "$match" || -z "${match#*=}" ]] ; then
+ echo $kname
+ exit 0
+ fi
+ # FIXME! need to figure out what to do here...
+
+ # The device mac address isn't yet in the config but the config
+ # has another hwid associated with the kernel name. This
+ # indicates that the device may have been replaced or a new device
+ # installed. Udev may not have scanned all devices yet so we
+ # donot know which case.
fi
exit 1