diff --git a/naxalnet/__init__.py b/naxalnet/__init__.py index 1509d4b..27941fb 100644 --- a/naxalnet/__init__.py +++ b/naxalnet/__init__.py @@ -35,4 +35,4 @@ See README.md for documentation. # # In case you forgot to change the version, skip the number # and put the next number in the next commit. -__version__ = "0.4.0a5.dev4" +__version__ = "0.4.0a5.dev5" diff --git a/naxalnet/network.py b/naxalnet/network.py index f1df64a..284a46f 100644 --- a/naxalnet/network.py +++ b/naxalnet/network.py @@ -71,7 +71,18 @@ class NetworkD: def delete_interface(self, name: str) -> None: """delete the given interface""" + # If anyone knows a better way of doing this, create + # an issue and get things done subprocess.run(["networkctl", "delete", name], check=True) + # This is probably not required. This is mainly to shut up + # pylint's messages + self.reload() + + def disable_config(self, name: str) -> None: + """Disable the config of the given name""" + path = self.runtime_path / name + path.symlink_to("/dev/null") + self.reload() def remove_config(self, name: str) -> None: """ diff --git a/naxalnet/scripts.py b/naxalnet/scripts.py index ed1ce02..3cd6561 100644 --- a/naxalnet/scripts.py +++ b/naxalnet/scripts.py @@ -93,6 +93,9 @@ def setup_mesh(gateway_mode: str = "off"): gateway_mode=gateway_mode, ) + # Fix for issue #19 + networkd.disable_config("80-wifi-adhoc.network") + for i in get_sorted_glob(args.networkd_config_dir, MESH_GLOB): logger.debug("Adding network config %s", i) networkd.add_config(i)