summaryrefslogtreecommitdiff
path: root/scripts/vyatta_net_name
diff options
context:
space:
mode:
authorTom Grennan <tgrennan@io.vyatta.com>2007-12-17 17:14:11 -0800
committerTom Grennan <tgrennan@io.vyatta.com>2007-12-17 17:14:11 -0800
commite21cc4704648b85f8eae737b1ca6194413231f72 (patch)
treeb69f4ce4b3ef89aad7731ad4e34bcbf938a0c0ef /scripts/vyatta_net_name
parent8be2a717500cbbfecf285bdb6fc3c148bfa74381 (diff)
downloadvyatta-cfg-system-e21cc4704648b85f8eae737b1ca6194413231f72.tar.gz
vyatta-cfg-system-e21cc4704648b85f8eae737b1ca6194413231f72.zip
support stand-alone validation
Diffstat (limited to 'scripts/vyatta_net_name')
-rwxr-xr-x[-rw-r--r--]scripts/vyatta_net_name13
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/vyatta_net_name b/scripts/vyatta_net_name
index 5cc1f4c5..43c71c1d 100644..100755
--- a/scripts/vyatta_net_name
+++ b/scripts/vyatta_net_name
@@ -108,7 +108,8 @@ for name_hwid in ${cfg_net_hwid[@]} ; do
if [ "$hwid" == "$attr_address" ] ; then
# we mod the config file interface sub-clock in case it is missing
# "link-detect"
- ${vyatta_sbindir}/mod_bootfile_eth_hwid $BOOTFILE $name $attr_address
+ [[ "$BOOTFILE" != *test_* ]] && \
+ ${vyatta_sbindir}/mod_bootfile_eth_hwid $BOOTFILE $name $attr_address
echo $name
exit 0
fi
@@ -119,18 +120,17 @@ done
[ -z "$kname" ] && \
exit 1
-
# have not found matching hwid in config, see if we can use kernel name
if [ -z "$match" ] ; then
# the kernel interface name isnot in config
# so, we might as well use it
name=$kname
- ${vyatta_sbindir}/add_bootfile_eth_hwid $BOOTFILE $name $attr_address
+ cmd=add
elif [ -z "${match#*=}" ] ; then
# the config has this interface but the sub-block is missing the hwid
# so again, we might as well use the kernel name
name=$kname
- ${vyatta_sbindir}/mod_bootfile_eth_hwid $BOOTFILE $name $attr_address
+ cmd=mod
else
# The device mac address is not in the config but the config
# has another hwid associated with the device name. This
@@ -139,9 +139,12 @@ else
# Since this is non-deterministic, we make a new name.
(( ethn = last_ethn + 1 ))
name=eth$ethn
- ${vyatta_sbindir}/add_bootfile_eth_hwid $BOOTFILE $name $attr_address
+ cmd=add
fi
+[[ "$BOOTFILE" != *test_* ]] && \
+ ${vyatta_sbindir}/${cmd}_bootfile_eth_hwid $BOOTFILE $name $attr_address
+
echo $name
# Local Variables: