+
+function get_devid(config)
+
+ local uci = require "uci"
+
+ local web_devid = uci.get(config,"web","devid")
+
+ if web_devid then
+ return web_devid
+ end
+
+ web_iface = uci.get(config,"web","iface")
+
+ if not web_iface then
+ web_iface = list_dir('/sys/class/net/')[1]
+ end
+
+ io.input("/sys/class/net/"..web_iface.."/address")
+
+ local web_devid = io.read("*line")
+ return web_devid:gsub(":",""):upper()
+
+end
\ No newline at end of file