From e21cc4704648b85f8eae737b1ca6194413231f72 Mon Sep 17 00:00:00 2001 From: Tom Grennan Date: Mon, 17 Dec 2007 17:14:11 -0800 Subject: support stand-alone validation --- scripts/vyatta_net_name | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) mode change 100644 => 100755 scripts/vyatta_net_name (limited to 'scripts/vyatta_net_name') diff --git a/scripts/vyatta_net_name b/scripts/vyatta_net_name old mode 100644 new mode 100755 index 5cc1f4c5..43c71c1d --- 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: -- cgit v1.2.3