ogboot_installer #4

Closed
aguerrero wants to merge 2 commits from ogboot_installer into main
1 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,4 @@
import os
#!/usr/bin/env python3
##################################################################################
##### 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_NAME = os.path.basename(sys.argv[0])
with open('config.json', 'r') as f:
config = json.load(f)
config_file = os.path.join(PROGRAM_DIR, 'config.json')
with open(config_file, 'r') as f:
config = json.load(f)
OGCORE_IP = config["ogCore_ServerIP"]
OGCORE_SERVER = config["ogCore_Server"]
@ -763,7 +765,7 @@ def smbConfigure():
with open(os.path.join(SAMBACFGDIR, 'smb-ogboot.conf'), 'w') as conf_file:
conf_file.write(replaced_template)
# Configurar y recargar Samba"
subprocess.run(["perl", "-pi", "-e", "s/WORKGROUP/OPENGNSYS/; s/server string \=.*/server string \= ogBoot Samba Server/", f"{SAMBACFGDIR}/smb.conf"])
subprocess.run(["perl", "-pi", "-e", "s/WORKGROUP/OPENGNSYS/; s/server string \\=.*/server string \\= ogBoot Samba Server/", f"{SAMBACFGDIR}/smb.conf"])
if "smb-ogboot" not in open(f"{SAMBACFGDIR}/smb.conf").read():
with open(f"{SAMBACFGDIR}/smb.conf", "a") as file:
file.write(f"include = {SAMBACFGDIR}/smb-ogboot.conf\n")