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
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". |
---|
| 8 | #**/ |
---|
| 9 | # CONFIGURAR: Partición de datos de Windows que no queremos ocultar |
---|
| 10 | PARTDATA=0 |
---|
| 11 | |
---|
| 12 | PROG="$(basename $0)" |
---|
| 13 | if [ $# -lt 2 ]; then |
---|
| 14 | ogRaiseError $OG_ERR_FORMAT "Formato: $PROG ndisco nparticion" |
---|
| 15 | exit $? |
---|
| 16 | fi |
---|
| 17 | |
---|
| 18 | MNTDIR=$(ogMount $1 $2) |
---|
| 19 | OSTYPE=$(ogGetOsType $1 $2) |
---|
| 20 | case "$OSTYPE" in |
---|
| 21 | Windows) |
---|
| 22 | # Mostrar las particiones NTFS de sistema y datos y ocultamos las demás. |
---|
| 23 | echo "[65] Activar particion de Windows $PART y ocultar las demás." |
---|
| 24 | for (( i=1; i<=$(ogGetPartitionsNumber $1); i++ )); do |
---|
| 25 | if [ $i == $2 -o $i == $PARTDATA ]; then |
---|
| 26 | [ $(ogGetPartitionType $1 $2) == "HNTFS" ] && ogUnhidePartition $1 $2 |
---|
| 27 | # Activo la particion si no es de datos |
---|
| 28 | [ $i -ne $PARTDATA ] && ogSetPartitionActive $1 $i |
---|
| 29 | else |
---|
| 30 | [ "$(ogGetPartitionType $1 $i)" == NTFS ] && ogHidePartition $1 $i |
---|
| 31 | fi |
---|
| 32 | done |
---|
| 33 | ;; |
---|
| 34 | Linux) |
---|
| 35 | # Cambiar claves usuarios, copiando fichero /etc/passwd |
---|
| 36 | # En el servidor el nuevo fichero debe situarse en el directorio del grupo: |
---|
| 37 | # /opt/opengnsys/images/groups/nombre_aula |
---|
| 38 | if [ -r $(ogGetGroupDir)/passwd ]; then |
---|
| 39 | echo "[65] Cambiar claves de usuarios." |
---|
| 40 | cp $(ogGetGroupDir)/passwd $MNTDIR/etc |
---|
| 41 | fi |
---|
| 42 | ;; |
---|
| 43 | esac |
---|
Note: See
TracBrowser
for help on using the repository browser.