diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-12-04 23:22:06 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-12-04 23:22:06 +0000 |
commit | 40f0bd6351bf06b0545331bbc770794d15cc991d (patch) | |
tree | 22d6220ce5cdc88e5d5e580bd87c5e776e700a03 /package/base-files/files/lib/network | |
parent | 533670025d4813a8454e643b003be1e0294432dc (diff) |
add option for setting the mac address (#1014)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5690 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/lib/network')
-rwxr-xr-x | package/base-files/files/lib/network/config.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh index 90f5bf742..8188203d3 100755 --- a/package/base-files/files/lib/network/config.sh +++ b/package/base-files/files/lib/network/config.sh @@ -66,6 +66,7 @@ setup_interface() { local iface="$1" local config="$2" local proto + local macaddr [ -n "$config" ] || { config=$(find_config "$iface") @@ -76,7 +77,8 @@ setup_interface() { config_get iftype "$config" type ifconfig "$iface" 2>/dev/null >/dev/null && { - # make sure the interface is removed from any existing bridge + # make sure the interface is removed from any existing bridge and brought down + ifconfig "$iface" down unbridge "$iface" } @@ -101,7 +103,8 @@ setup_interface() { # Interface settings config_get mtu "$config" mtu - $DEBUG ifconfig "$iface" ${mtu:+mtu $mtu} up + config_get macddr "$config" macaddr + $DEBUG ifconfig "$iface" ${macaddr:+hw ether "$macaddr"} ${mtu:+mtu $mtu} up pidfile="/var/run/$iface.pid" case "$proto" in |