2
0
Fork 0
This repository has been archived on 2019-12-19. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
ffka-querfunk/bat-hosts-gen

13 lines
401 B
Python
Executable file

#!/usr/bin/python
from __future__ import division, print_function
import requests
r = requests.get('http://mapsrv0.ffka.net/json/ffka/nodes.json')
j = r.json()
for nodeid in j['nodes'].keys():
nodeinfo = j['nodes'][nodeid]['nodeinfo']
hostname = nodeinfo['hostname']
for i, mac in enumerate(nodeinfo['network']['mesh_interfaces']):
print('{} {}_int{}'.format(mac, hostname, i))