summaryrefslogtreecommitdiffstats
path: root/src/live
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-10-01 10:14:48 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-10-01 15:32:54 +0200
commite30e934272f16e3fa60454c37692034064a33a5c (patch)
tree1ce5a32c25581a201d2129a1aa55f4cf53acd1bc /src/live
parent8f437bb954266d1da31c7044edcdc2d9f4cef540 (diff)
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.
Diffstat (limited to 'src/live')
-rw-r--r--src/live/ogOperations.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py
index 2f59711..48bb1ee 100644
--- a/src/live/ogOperations.py
+++ b/src/live/ogOperations.py
@@ -24,7 +24,7 @@ from src.live.parttypes import get_parttype
from src.utils.image import *
from src.utils.postinstall import configure_os
-from src.utils.net import ethtool
+from src.utils.net import *
from src.utils.menu import generate_menu
from src.utils.fs import *
from src.utils.probe import os_probe, get_cache_dev_path
@@ -343,7 +343,7 @@ class OgLiveOperations:
f.truncate(0)
def _poweroff_oglive(self, operation='poweroff'):
- interface = os.getenv('DEVICE')
+ interface = get_ethernet_interface()
cmd_ethtool = shlex.split(f'ethtool -s {interface} wol g')
cmd_browser = shlex.split('pkill -9 browser')
if shutil.which('busybox'):
@@ -772,7 +772,7 @@ class OgLiveOperations:
cache = get_cache_dev_path()
disks = get_disks()
- interface = os.getenv('DEVICE')
+ interface = get_ethernet_interface()
link = ethtool(interface)
json_body = { 'serial_number': '',
'disk_setup': [],