Skip to content

Commit 525b9df

Browse files
Merge pull request #22 from CreatorKit/dev
Merge dev to master
2 parents 9977d03 + 979e2bf commit 525b9df

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ If there is no ethernet connected, you can also use the SoftAp to onboard the de
3030
- It should connect to the selected wireless network.
3131

3232
### Outstanding issues
33-
- WiFi MAC address is hardcoded to 00:11:22:33:44:55.
3433
- SoftAp is always active even after connecting to WiFi network.

src/cgi-bin/connection.lua

+8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ function configure_network(network, encryption, key)
2121
else
2222
uci.delete("wireless", "sta", "key")
2323
end
24+
os.execute(". /usr/bin/get_mac.sh 0")
25+
local file = io.open("/tmp/MAC", "r")
26+
if not file then
27+
return 1
28+
end
29+
local mac_address = file:read "*a"
30+
file:close()
31+
uci.set("wireless", "sta", "macaddr", mac_address)
2432
uci.save("wireless")
2533
uci.commit("wireless")
2634
end

0 commit comments

Comments
 (0)