diff --git a/contrib/get_current_ap.py b/contrib/get_current_ap.py new file mode 100755 index 0000000..b812a1d --- /dev/null +++ b/contrib/get_current_ap.py @@ -0,0 +1,15 @@ +#!/usr/bin/python + +import subprocess +from pymongo import MongoClient +client = MongoClient() + +db = client.freifunk + +# this tool will try to show you the hostname of the Freifunk AP you are currently connected to + +mac = subprocess.check_output(["iwgetid", "-ar"]).strip().lower().decode() + +router = db.routers.find_one({"netifs.mac": mac}) + +print(router["hostname"])