refs #401 removes loop for fot interface and fix routes of ogadmclient conf template

ogboot_installer
Luis Gerardo Romero Garcia 2024-05-29 11:44:34 +02:00
parent 50be00d01d
commit 98768fcef7
1 changed files with 10 additions and 18 deletions

View File

@ -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: