refs #1633 unhardcode IP address in OGLOGFILE

bootlib
Natalia Serrano 2025-03-06 11:07:53 +01:00
parent 59b702047d
commit fb0d520739
1 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,10 @@ import os.path
import locale
import importlib.util
## required for defining OGLOGFILE
import NetLib
ip = NetLib.ogGetIpAddress()
def load_lang (name):
global lang
if name in sys.modules:
@ -57,11 +61,12 @@ OGBIN = os.path.join (OPENGNSYS, 'bin')
OGETC = os.path.join (OPENGNSYS, 'etc')
OGLIB = os.path.join (OPENGNSYS, 'lib')
OGAPI = os.path.join (OGLIB, 'engine', 'bin')
OGPYFUNCS = os.path.join (OPENGNSYS, 'functions')
OGSCRIPTS = os.path.join (OPENGNSYS, 'scripts')
OGIMG = os.path.join (OPENGNSYS, 'images')
OGCAC = os.path.join (OPENGNSYS, 'cache')
OGLOG = os.path.join (OPENGNSYS, 'log')
OGLOGFILE = f'{OGLOG}/192.168.42.42' ## TODO import NetLib; OGLOGFILE = f'$OGLOG/{NetLib.ogGetIpAddress()}.log'
OGLOGFILE = f'{OGLOG}/{ip}.log'
DEBUG = 'yes'
_path = os.environ['PATH'] + ':/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/opt/oglive/rootfs/opt/drbl/sbin'
os.environ['PATH'] = ':'.join ([OGSCRIPTS, _path, OGAPI, OGBIN])