Skip to content

Commit 4192ad5

Browse files
author
Abhijit A. Mahajani
authored
Merge pull request #20 from pratik-prajapati-imgtec/set_wifi_mac
Set wifi mac address
2 parents b973e7e + 6c86f89 commit 4192ad5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cgi-bin/connection.lua

Lines changed: 8 additions & 0 deletions
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)