diff --git a/files/usr/local/bin/bbhn-postupgrade b/files/usr/local/bin/bbhn-postupgrade index 59a1cf90..6137bc3a 100755 --- a/files/usr/local/bin/bbhn-postupgrade +++ b/files/usr/local/bin/bbhn-postupgrade @@ -13,8 +13,8 @@ if ( ! $needsrun ){ #Prep some variables $node = nvram_get("node"); $tactical = nvram_get("tactical"); -$mac2 = mac2ip(get_mac("wlan0"), 0); -$dtdmac = mac2ip(get_mac("eth0"), 0); +$mac2 = mac2ip(get_mac(get_interface("wifi")), 0); +$dtdmac = mac2ip(get_mac(get_interface("lan")), 0); foreach $config ("ap","client","mesh","mesh_ap","router") diff --git a/files/usr/local/bin/node-setup b/files/usr/local/bin/node-setup index 559065ec..ad6b9455 100755 --- a/files/usr/local/bin/node-setup +++ b/files/usr/local/bin/node-setup @@ -73,8 +73,8 @@ die "'$config' is not a valid configuration\n" unless -f "/etc/config.$config/_s $node = nvram_get("node"); $tactical = nvram_get("tactical"); -$mac2 = mac2ip(get_mac("wlan0"), 0); -$dtdmac = mac2ip(get_mac("eth0"), 0); +$mac2 = mac2ip(get_mac(get_interface("wifi")), 0); +$dtdmac = mac2ip(get_mac(get_interface("lan")), 0); unless($auto) { diff --git a/files/usr/local/bin/nvram-setup b/files/usr/local/bin/nvram-setup index 08eecdd9..88fe6617 100755 --- a/files/usr/local/bin/nvram-setup +++ b/files/usr/local/bin/nvram-setup @@ -105,7 +105,10 @@ chomp ($dtdmac = `uci -c /etc/local/uci/ -q get hsmmmesh.settings.dtdmac`); if($dtdmac eq "") { - + # We should always have an eth0 interface on all nodes. + # Not porting get_interface into this file at this time + # as on a firstboot where nvram-setup runs the interfaces + # should not be changed yet. open(FILE, "/sbin/ifconfig eth0 |") or fail("ERROR: eth0 mac not available"); while() { diff --git a/files/usr/local/bin/olsrd-config b/files/usr/local/bin/olsrd-config index b642fc82..3395cb85 100755 --- a/files/usr/local/bin/olsrd-config +++ b/files/usr/local/bin/olsrd-config @@ -65,7 +65,7 @@ if(-f "/etc/config/dmz-mode") if ($name = nvram_get("node")) { my ($dtdip,$dtdmask,$dtdbcast,$dtdnet); - ($dtdip, $dtdmask, $dtdbcast, $dtdnet) = get_ip4_network("eth0.2"); + ($dtdip, $dtdmask, $dtdbcast, $dtdnet) = get_ip4_network(get_interface("dtdlink")); push @hosts, qq("$dtdip" "dtdlink.$name.local.mesh"); }