918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change
on this file since 18391d1 was
6963f42,
checked in by irina <irinagomez@…>, 8 years ago
|
#773 Se corrige bootOs para que llame al script bootOsCustom.template. bootOsCustom.template: El código personalizado se muestra comentado y con una descripción de lo que hace.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5189 a21b9725-9963-47de-94b9-378ad31fedc9
|
-
Property mode set to
100755
|
File size:
2.1 KB
|
Rev | Line | |
---|
[dcddace] | 1 | #!/bin/bash |
---|
| 2 | #/** |
---|
| 3 | # bootOsCustom |
---|
| 4 | #@brief Plantilla para script de configuración personalizada de sistema operativo restaurado. |
---|
| 5 | #@param $1 nº de disco |
---|
| 6 | #@param $2 nº de partición |
---|
| 7 | #@warning Renombrar este fichero como "bootOsCustom" para personalizar el script estándar "bootOs". |
---|
[6963f42] | 8 | #@note La partición a inicializar debe estar montada |
---|
[dcddace] | 9 | #**/ |
---|
| 10 | # CONFIGURAR: Partición de datos de Windows que no queremos ocultar |
---|
| 11 | PARTDATA=0 |
---|
| 12 | |
---|
| 13 | PROG="$(basename $0)" |
---|
[6963f42] | 14 | # Control de errores |
---|
[dcddace] | 15 | if [ $# -lt 2 ]; then |
---|
| 16 | ogRaiseError $OG_ERR_FORMAT "Formato: $PROG ndisco nparticion" |
---|
| 17 | exit $? |
---|
| 18 | fi |
---|
| 19 | |
---|
[6963f42] | 20 | # Parámetros obligatorios. |
---|
| 21 | DISK="$1" # Nº de disco. |
---|
| 22 | PART="$2" # Nº de partición. |
---|
| 23 | |
---|
| 24 | # Paso 0: Añadir código para realizar control de errores de los parámetros de entrada (recomendado). |
---|
| 25 | |
---|
| 26 | # Paso 1: Adaptar el código de ejemplo para postconfiguración personalizada. |
---|
| 27 | # Nota: el script "bootOs" llama al script "bootOsCustom" después de realizar la operaciones de inicio estándar y antes de desmontar las particiones e iniciar el sistema operativo. |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | MNTDIR=$(ogMount $DISK $PART) |
---|
| 31 | OSTYPE=$(ogGetOsType $DISK $PART) |
---|
[dcddace] | 32 | case "$OSTYPE" in |
---|
| 33 | Windows) |
---|
[6963f42] | 34 | ## Mostrar las particiones NTFS de sistema y datos y ocultamos las demás. |
---|
| 35 | #echo "[65] Activar particion de Windows $PART y ocultar las demás." |
---|
| 36 | #for (( i=1; i<=$(ogGetPartitionsNumber $DISK); i++ )); do |
---|
| 37 | # if [ $i == $PART -o $i == $PARTDATA ]; then |
---|
| 38 | # [ $(ogGetPartitionType $DISK $PART) == "HNTFS" ] && ogUnhidePartition $1 $PART |
---|
| 39 | # # Activo la particion si no es de datos |
---|
| 40 | # [ $i -ne $PARTDATA ] && ogSetPartitionActive $DISK $i |
---|
| 41 | # else |
---|
| 42 | # [ "$(ogGetPartitionType $DISK $i)" == NTFS ] && ogHidePartition $DISK $i |
---|
| 43 | # fi |
---|
| 44 | #done |
---|
[dcddace] | 45 | ;; |
---|
| 46 | Linux) |
---|
[6963f42] | 47 | ## Cambiar claves usuarios, copiando fichero /etc/passwd |
---|
| 48 | ## En el servidor el nuevo fichero debe situarse en el directorio del grupo: |
---|
| 49 | ## /opt/opengnsys/images/groups/nombre_aula |
---|
| 50 | #if [ -r $(ogGetGroupDir)/passwd ]; then |
---|
| 51 | # echo "[65] Cambiar claves de usuarios." |
---|
| 52 | # cp $(ogGetGroupDir)/passwd $MNTDIR/etc |
---|
| 53 | #fi |
---|
[dcddace] | 54 | ;; |
---|
| 55 | esac |
---|
Note: See
TracBrowser
for help on using the repository browser.