Developing lightweight computation at the DSG edge

Commit f63c9311 authored by p4u's avatar p4u
Browse files

New option for qmpinfo to get qmp_key value

parent abc1f238
......@@ -34,6 +34,7 @@ function print_help()
print(" hostname : print device hostname")
print(" bwtest <ipv6> : perform a bandwidth test")
print(" nodes : list all nodes on MESH network")
print(" key : print qmp key")
print("")
end
......@@ -100,6 +101,10 @@ function nodes()
end
end
function key()
print(qmpinfo.get_key())
end
if #arg < 1 then
print_help()
os.exit(1)
......@@ -122,6 +127,8 @@ elseif question == "bwtest" then
bw_test()
elseif question == "nodes" then
nodes()
elseif question == "key" then
key()
else
print_help()
end
......
......@@ -173,4 +173,13 @@ function qmpinfo.nodes()
return result
end
function qmpinfo.get_key()
local keyf = util.exec("uci get qmp.node.key")
if #keyf < 2 then
keyf = "/tmp/qmp_key"
end
local key = util.split(util.exec("cat "..keyf))[1]
return key
end
return qmpinfo
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment