#!/usr/bin/python3 #/** # restoreImageCustom #@brief Plantilla para scirpt de rastauración personalizada de imagen. #@param $1 nº de disco #@param $2 nº de partición #@param $3 Repositorio: CACHE, REPO o dirección IP #@param $4 Nombre canónico de la imagen sin extensión #@warning Renombrar este fichero como "restoreImageCustom" para sustituir al script estándar "restoreImage". #**/ import sys import subprocess import ogGlobals from SystemLib import ogRaiseError # Control de parámetros. if len (sys.argv) < 5 or len (sys.argv) > 7): ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, f'restoreImageCustom str_repo str_imagen int_ndisco int_npart [ str_proto ["str_opciones"] ]') sys.exit (1) # Toma de parámetros. repo, imgname, disk, par, *other = sys.argv[1:] repo = repo.upper() proto = other[0].upper() if len (other) > 0 else 'UNICAST' protoopt = other[1] if len (other) > 1 else '' subprocess.run (['restoreImage.py', repo, imgname, disk, par, proto, protoopt])