Skip to content
Snippets Groups Projects
Commit 2dfe68d5 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

Remove obsolete legacy upgrade script

parent c06141cf
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/lua
local sysconfig = require 'gluon.sysconfig'
local platform = require 'gluon.platform'
local uci = require('luci.model.uci').cursor()
local util = require 'luci.util'
local nixio = require 'nixio'
if platform.match('ar71xx', 'generic', {'tl-wr1043nd', 'tl-wdr3600', 'tl-wdr4300'}) then
-- fix up duplicate mac addresses
local m1, m2, m3, m4, m5, m6 = string.match(sysconfig.primary_mac, '(%x%x):(%x%x):(%x%x):(%x%x):(%x%x):(%x%x)')
m1 = nixio.bit.bor(tonumber(m1, 16), 0x02)
m4 = (tonumber(m4, 16)+1) % 0x100
m6 = (tonumber(m6, 16)+1) % 0x100
local wanaddr = string.format('%02x:%s:%s:%02x:%s:%02x', m1, m2, m3, m4, m5, m6)
uci:set('network', 'wan', 'macaddr', wanaddr)
end
uci:save('network')
uci:commit('network')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment