From e30e934272f16e3fa60454c37692034064a33a5c Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Tue, 1 Oct 2024 10:14:48 +0200 Subject: src: replace DEVICE env variable with get_ethernet_interface() Use a python function to obtain the main net interface. Detect the first ethernet inferface in use. Stop using the DEVICE environment variable. --- src/utils/menu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/utils/menu.py') diff --git a/src/utils/menu.py b/src/utils/menu.py index 48e2641..b615d6f 100644 --- a/src/utils/menu.py +++ b/src/utils/menu.py @@ -13,7 +13,7 @@ Utility module for ogBrowser menu generation import os import socket -from src.utils.net import getifaddr, getifhwaddr, ethtool +from src.utils.net import * MENU_TEMPLATE = """
@@ -39,7 +39,7 @@ def generate_menu(part_setup): Writes html menu to /opt/opengnsys/log/{ip}.info.html based on a partition setup """ - device = os.getenv('DEVICE') + device = get_ethernet_interface() if not device: return False -- cgit v1.2.3-18-g5258