Skip to content

Latest commit

 

History

History
55 lines (36 loc) · 1.37 KB

README.md

File metadata and controls

55 lines (36 loc) · 1.37 KB

Freifunk: meshviewer.json to zonefile

generateZonefile.py is a script intended to run regularly as cron and generate a zonefile for a subdomain which contains all the Freifunk Router of a Freifunk community so that they are accesible with a name.

It uses a http request to get a meshviewer.json, extracts all the valid hostnames and outputs a zonefile for a "node domain".

Installation

  • clone this repository
  • create a copy of the config.example.py with the name config.py and edit it
  • run it with python3 generateZonefile.py

Limitations

Hostname Limitations:

  • must only contain letters a-z, numbers, german umlauts (äöü)
  • must not start or end with a dash (-)

not valid are:

Example Script

It is probably better to run the following two parts separate:

generate Files

#!/usr/bin/env bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

cd $DIR

python3 generateZonefile.py > nodes.ffrn.de.log

reload zone

#!/usr/bin/env bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

cd $DIR

cp nodes.ffrn.de.zone /etc/bind/zones/
/usr/sbin/rndc reload nodes.ffrn.de > /dev/null