09.10.2021, 09:24
You can get the IP like this:
Code:
info = io.readproc('zerotier-cli -D/var/lib/zerotier-one_default/ -j listnetworks')
info = require('json').pdecode(info)
if type(info) == 'table' then
net = info[1]
if type(net) == 'table' and type(net.assignedAddresses) == 'table' then
ip = net.assignedAddresses[1]:gsub('/%d+', '') --remove subnet part
end
end
log(ip)