From 94f070e0ffdbda3bc78bab37727f8b3f1f01314d Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Thu, 8 Jun 2023 11:36:09 -0700 Subject: [PATCH] cleanup: fixed issue cleaning up device names with @ in them --- daemon/core/scripts/cleanup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon/core/scripts/cleanup.py b/daemon/core/scripts/cleanup.py index 3606fc13..1ab4647e 100755 --- a/daemon/core/scripts/cleanup.py +++ b/daemon/core/scripts/cleanup.py @@ -61,7 +61,7 @@ def cleanup_sessions() -> None: def cleanup_interfaces() -> None: print("cleaning up devices") - output = subprocess.check_output("ip -o -br link show", shell=True) + output = subprocess.check_output("ip -br link show", shell=True) lines = output.decode().strip().split("\n") for line in lines: values = line.split() @@ -73,6 +73,7 @@ def cleanup_interfaces() -> None: or name.startswith("b.") or name.startswith("ctrl") ): + name = name.split("@")[0] result = subprocess.call(f"ip link delete {name}", shell=True) if result: print(f"failed to remove {name}")