mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-08-21 22:37:43 +03:00
add option for setting the mac address (#1014)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5690 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
533670025d
commit
40f0bd6351
@ -66,6 +66,7 @@ setup_interface() {
|
|||||||
local iface="$1"
|
local iface="$1"
|
||||||
local config="$2"
|
local config="$2"
|
||||||
local proto
|
local proto
|
||||||
|
local macaddr
|
||||||
|
|
||||||
[ -n "$config" ] || {
|
[ -n "$config" ] || {
|
||||||
config=$(find_config "$iface")
|
config=$(find_config "$iface")
|
||||||
@ -76,7 +77,8 @@ setup_interface() {
|
|||||||
config_get iftype "$config" type
|
config_get iftype "$config" type
|
||||||
|
|
||||||
ifconfig "$iface" 2>/dev/null >/dev/null && {
|
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"
|
unbridge "$iface"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +103,8 @@ setup_interface() {
|
|||||||
|
|
||||||
# Interface settings
|
# Interface settings
|
||||||
config_get mtu "$config" mtu
|
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"
|
pidfile="/var/run/$iface.pid"
|
||||||
case "$proto" in
|
case "$proto" in
|
||||||
|
Loading…
Reference in New Issue
Block a user