Browse Source

add support for mutiple mesh-interfaces

Marcus Scharf 8 years ago
parent
commit
a3486c5edb
3 changed files with 9 additions and 7 deletions
  1. 2 2
      README.md
  2. 3 3
      config.json.example
  3. 4 2
      ext-respondd.py

+ 2 - 2
README.md

@@ -19,9 +19,9 @@ Copy `config.json.example` to `config.json` and change it to match your server c
 (`cp config.json.example config.json`)
 
  * `batman` (string) (Needed: typical bat0)
- * `fastd` (string) (Needed: typical mesh-vpn)
  * `bridge` (string) (Needed: typical br-client)
- * `mesh-wlan` (string) (Optional: Ad-Hoc batman-Mesh)
+ * `mesh-wlan` (array of string) (Optional: Ad-Hoc batman-Mesh)
+ * `mesh-vpn` (array of string) (Optional: fastd, GRE, L2TP batman-Mesh)
  * `wan` (string) (Needed: for primary MAC-Address and node-id)
  * `fastd_socket` (string) (Optional: needed for uplink-flag)
 

+ 3 - 3
config.json.example

@@ -1,8 +1,8 @@
 {
     "batman": "bat0",
-    "fastd": "mesh-vpn",
-    "bridge": "br-client"
-    "mesh-wlan": "wlan0"
+    "bridge": "br-client",
     "wan": "eth0",
+    "mesh-vpn": [ "mesh-vpn" ],
+    "mesh-wlan": [ "ibss0", "mesh0" ],
     "fastd_socket": "/var/run/fastd.mesh_vpn.socket"
 }

+ 4 - 2
ext-respondd.py

@@ -128,9 +128,11 @@ def getBat0_Interfaces():
         nif = dev_line.group(0)
 
         if_group = ""
-        if nif == config["fastd"]:
+        if "fastd" in config and nif == config["fastd"]: # keep for compatibility
             if_group = "tunnel"
-        elif "mesh-wlan" in config and nif == config["mesh-wlan"]:
+        elif "mesh-vpn" in config and nif in config["mesh-vpn"]:
+            if_group = "tunnel"
+        elif "mesh-wlan" in config and nif in config["mesh-wlan"]:
             if_group = "wireless"
         else:
             if_group = "other"