source: admin/Interface/CrearImagen @ cd95622

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 cd95622 was ad1f809, checked in by adv <adv@…>, 14 years ago

version 1.0.1 #357 comando->Restaurar(torrent,multicast,unicast), comando->CrearImagen? en cache MASTER-REPOSITORIO

git-svn-id: https://opengnsys.es/svn/branches/version1.0@2047 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100755
File size: 2.2 KB
Line 
1#!/bin/bash
2
3#___________________________________________________
4#
5# PARAMETROS RECIBIDOS DESDE EL CLIENTE:
6# $1 Número de disco
7# $2 Número de particion
8# $3 Nombre canónico de la imagen (sin extensión)
9# $4 Dirección del repositorio (REPO, por defecto)
10#___________________________________________________
11
12
13#$OG_ERR_NOTEXEC    Si no es llamada por OG client
14#$OG_ERR_LOCKED=4    Si la particion está bloqueada.
15
16
17#Codigos de error del scripts createImage
18#@exception OG_ERR_FORMAT     # 1 formato incorrecto.
19#@exception OG_ERR_PARTITION  # 3 Error en partición de disco o en su sistema de archivos
20#@exception OG_ERR_IMAGE      # 5 Error en funcion ogCreateImage o ogRestoreImage.
21#@exception OG_ERR_NOTWRITE   # 14 error de escritura
22#@exception OG_ERR_NOTCACHE   # 15 si cache no existe 15
23#@exception OG_ERR_CACHESIZE  # 16 si espacio de la cache local o remota no tiene espacio 16
24#@exception OG_ERR_REDUCEFS   # 17 error al reducir sistema de archivos.
25#@exception OG_ERR_EXTENDFS   # 18 Errror al expandir el sistema de archivos.
26
27
28#Códigos de error de la funcion ogCreateImage
29
30
31
32
33# Registro de ejecución
34echo $* >> $OGLOGFILE
35
36# Solo ejecutable por OpenGnSys Client.
37PATH=$PATH:$(dirname $0)
38PROG=$(basename $0)
39CALLER=$(ogGetCaller)
40if [ "$CALLER" != "ogAdmClient" ]; then
41        ogRaiseError $OG_ERR_NOTEXEC "$CALLER -> $PROG"
42        exit $?
43fi
44
45# Si el origen(pariticion) esta bloqueada salir.
46
47#if ogIsLocked $1 $2; then
48#       ogRaiseError $OG_ERR_LOCKED "$MSG_PARTITION, $1 $2"
49#       exit $?
50#fi
51
52
53# Valor por defecto para el repositorio.
54REPO=${4:-"REPO"}
55[ "$REPO" == "$(ogGetRepoIp)" ] && REPO="REPO"
56[ "$REPO" == "$(ogGetIpAddress)" ] && REPO="CACHE"
57[ "$REPO" == "CACHE" ] && REPO="CACHE"
58
59# Si el destino es REPO y el cliente no está en modo "admin"; activar repositorio para escritura,
60if [ "$REPO" == "REPO" -a "$boot" != "admin"  ]
61then
62        CambiarAcceso admin &>> $OGLOGFILE
63        RETVAL=$?
64        [ $RETVAL -gt 0 ] && exit $RETVAL       
65fi
66
67
68
69if [ -f createImage$ogengine ]; then
70        createImage$ogengine "$1" "$2" "$REPO" /"$3" &>> $OGLOGFILE
71else
72        createImage "$1" "$2" "$REPO" /"$3" &>> $OGLOGFILE
73fi
74RETVAL=$?
75
76[ "$REPO" == "REPO" -a "$boot" != "admin" ] && CambiarAcceso user
77
78if [ $RETVAL == 0 ]
79then
80        rm $OGLOGFILE
81        touch $OGLOGFILE
82else
83        echo $RETVAL &>> $OGLOGFILE
84fi
85
86exit $RETVAL
87
Note: See TracBrowser for help on using the repository browser.