From 7082f5c70f29502de722dcbfe06d4a13e2954795 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Mon, 11 Feb 2008 18:41:52 -0800 Subject: fix for bug 2547: don't require/output ':' after "hw-id". --- scripts/add_bootfile_eth_hwid | 2 +- scripts/mod_bootfile_eth_hwid | 4 ++-- scripts/vyatta_net_name | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/add_bootfile_eth_hwid b/scripts/add_bootfile_eth_hwid index a315a103..61deea56 100755 --- a/scripts/add_bootfile_eth_hwid +++ b/scripts/add_bootfile_eth_hwid @@ -24,6 +24,6 @@ hwid=$3 sed -i '/^interfaces {$/,/^}$/ { /^}$/i\ ethernet '"$eth"' {\ - hw-id: '"$hwid"'\ + hw-id '"$hwid"'\ } }' $bootfile diff --git a/scripts/mod_bootfile_eth_hwid b/scripts/mod_bootfile_eth_hwid index 51b2c022..feab64f1 100755 --- a/scripts/mod_bootfile_eth_hwid +++ b/scripts/mod_bootfile_eth_hwid @@ -25,8 +25,8 @@ sed -i '/^interfaces {$/,/^}$/ { /^ ethernet '"$eth"' {$/ { :join /\n }$/ { - /hw-id: / s/\(hw-id:\) [0-9a-fA-F:]\+/\1 '"$hwid"'/ - /hw-id: /! s/}$/ hw-id: '"$hwid"'\n }/ + /hw-id:\? / s/\(hw-id\):\? [0-9a-fA-F:]\+/\1 '"$hwid"'/ + /hw-id:\? /! s/}$/ hw-id '"$hwid"'\n }/ b } N diff --git a/scripts/vyatta_net_name b/scripts/vyatta_net_name index 9820d00f..61792340 100755 --- a/scripts/vyatta_net_name +++ b/scripts/vyatta_net_name @@ -71,7 +71,7 @@ shopt -s extglob nullglob # ... # ethernet eth# { # ... -# hw-id: XX:XX:XX:XX:XX:XX +# hw-id XX:XX:XX:XX:XX:XX # ... # } # } @@ -86,9 +86,9 @@ declare -a cfg_net_hwid=( $( sed -ne ' # hold interface name h } - /^.*hw-id:/ { + /^.*hw-id:\?/ { # translate field name - s/.*hw-id: *// + s/.*hw-id:\? *// # tolower hex mac address y/ABCDEF/abcdef/ # exchange hold and pattern space -- cgit v1.2.3