refs #535 Adds program dir to open the config.json

ogboot_debian_installer
Luis Gerardo Romero Garcia 2024-08-19 07:00:48 +02:00
parent f0e390aa98
commit c9bdb52da8
1 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,4 @@
import os
#!/usr/bin/env python3 #!/usr/bin/env python3
################################################################################## ##################################################################################
##### ogBoot installer script #### ##### ogBoot installer script ####
@ -12,8 +13,9 @@ PROGRAM = os.path.splitext(os.path.basename(sys.argv[0]))[0]
PROGRAM_DIR = os.path.dirname(os.path.realpath(sys.argv[0])) PROGRAM_DIR = os.path.dirname(os.path.realpath(sys.argv[0]))
PROGRAM_NAME = os.path.basename(sys.argv[0]) PROGRAM_NAME = os.path.basename(sys.argv[0])
with open('config.json', 'r') as f: config_file = os.path.join(PROGRAM_DIR, 'config.json')
config = json.load(f) with open(config_file, 'r') as f:
config = json.load(f)
OGCORE_IP = config["ogCore_ServerIP"] OGCORE_IP = config["ogCore_ServerIP"]
OGCORE_SERVER = config["ogCore_Server"] OGCORE_SERVER = config["ogCore_Server"]