From 98768fcef7c8bcf25789ba9bbfdc454e04e34e42 Mon Sep 17 00:00:00 2001 From: lgromero Date: Wed, 29 May 2024 11:44:34 +0200 Subject: [PATCH] refs #401 removes loop for fot interface and fix routes of ogadmclient conf template --- installer/ogboot_installer.py | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/installer/ogboot_installer.py b/installer/ogboot_installer.py index b470ce9..ea0e1c5 100755 --- a/installer/ogboot_installer.py +++ b/installer/ogboot_installer.py @@ -724,24 +724,16 @@ def openGnsysConfigure(): # Para nuetra demo 172.17.8.82 print(f"{openGnsysConfigure.__name__}(): Creating OpenGnsys config files.") - for dev in DEVICE: - if dev: - if SERVERIP[i]: - CONSOLEURL = f"https://{SERVERIP[i]}/opengnsys" - with open(f"{WORKDIR}/opengnsys/admin/Sources/Clients/ogAdmClient/ogAdmClient.cfg") as file: - content = file.read() - content = content.replace("SERVERIP", SERVERIP[i]) - content = content.replace("OPENGNSYSURL", CONSOLEURL.replace("/", "\\/")) - with open(f"{INSTALL_TARGET}/client/etc/ogAdmClient-{dev}.cfg", "w") as outfile: - outfile.write(content) - if dev == DEFAULTDEV: - OPENGNSYS_CONSOLEURL = CONSOLEURL - i += 1 - if DEFAULTDEV: - os.link(f"{INSTALL_TARGET}/client/etc/ogAdmClient-{DEFAULTDEV}.cfg", f"{INSTALL_TARGET}/client/etc/ogAdmClient.cfg") - else: - print("Error: No se ha detectado la interfaz de red por defecto.") - exit(1) + CONSOLEURL = f"https://{SERVER_OPENGNSYS[i]}/opengnsys" + with open(f"{WORKDIR}/ogboot/etc/ogAdmClient.cfg") as file: + content = file.read() + content = content.replace("SERVERIP", SERVER_OPENGNSYS[i]) + content = content.replace("OPENGNSYSURL", CONSOLEURL.replace("/", "\\/")) + with open(f"{INSTALL_TARGET}/client/etc/ogAdmClient-eth0.cfg", "w") as outfile: + outfile.write(content) + + os.link(f"{INSTALL_TARGET}/client/etc/ogAdmClient-eth0.cfg", f"{INSTALL_TARGET}/client/etc/ogAdmClient.cfg") + TZ = subprocess.check_output(["timedatectl", "status"]).decode().split("\n")[2].split(":")[1].strip() with open(f"{INSTALL_TARGET}/client/etc/engine.cfg", "a") as file: