33 lines
946 B
Python
Executable File
33 lines
946 B
Python
Executable File
#!/usr/bin/python3
|
|
|
|
# configureOsCustom
|
|
# Plantilla para scirpt de configuracion personalizada de sistema operativo restaurado.
|
|
# configureOsCustom $disk $part $repo $nombre
|
|
|
|
import sys
|
|
import subprocess
|
|
|
|
import ogGlobals
|
|
from SystemLib import ogRaiseError, ogEcho
|
|
from InventoryLib import ogGetOsType
|
|
|
|
prog = sys.argv[0]
|
|
|
|
if len (sys.argv) not in [3, 5]:
|
|
ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, f'{ogGlobals.lang.MSG_FORMAT} configureOsCustom int_ndisc int_npart [str_repo str_imgname]')
|
|
sys.exit (1)
|
|
disk, par, *other = sys.argv[1:]
|
|
repo = other[0].upper() if len (other) > 0 else ''
|
|
imgname = other[1] if len (other) > 1 else ''
|
|
|
|
# Nota: incluye llamada al script "configureOs" para realizar previamente una configuración estándar.
|
|
subprocess.run ([f'configureOs', disk, par, imgname])
|
|
|
|
ostype = ogGetOsType (disk, par)
|
|
if 'Windows' == ostype:
|
|
pass
|
|
elif 'Linux' == ostype:
|
|
pass
|
|
elif 'MacOS' == ostype:
|
|
pass
|