source: server/bin/unmountimage @ 8361974

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 8361974 was 8361974, checked in by irina <irinagomez@…>, 12 years ago

#565 comandos para manipular las imagenes sincronizadas desde el servidor

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

  • Property mode set to 100755
File size: 1.6 KB
Line 
1#!/bin/bash
2#/**
3#        mountimage
4#@brief  Monta imagen sincronizable en el repositorio con permisos de escritura
5#@param 1 imagen
6#@param 2 extension [ img|diff ] opcional, por defecto img
7#@return 
8#@exception OG_ERR_FORMAT     # 1 formato incorrecto.
9#@exception OG_ERR_NOTFOUND # 2 Fichero o dispositivo no encontrado
10#@exception OG_ERR_DONTSYNC_IMAGE  #71 Imagen no sincronizable (es monolitica)
11#@exception OG_ERR_DONTMOUNT_IMAGE # 70 Error al montar una imagen sincronizada
12#@version 1.0 - Montar imagen sincronizable
13#@author  Irina Gomez
14#@date   2013-05-15
15#*/ ##
16BASEDIR=/opt/opengnsys
17REPODIR="$BASEDIR/images"
18REPOLOG=$BASEDIR/log/ogAdmRepo.log
19source $BASEDIR/client/etc/lang.$LANG.conf
20
21PROG="$(basename $0)"
22# Si se solicita, mostrar ayuda.
23if [ "$*" == "help" ]; then
24    echo -e " $PROG: $MSG_HELP_ogUnmountImage \n" \
25            "$MSG_FORMAT: $PROG nombre_image [ img|diff ] \n" \
26            "base -> $PROG Windows7 \n" \
27            "diff -> $PROG Ubuntu12 diff"
28   exit 0
29fi
30
31[ $# -lt 1 ] && echo -e "$PROG: Error: $MSG_ERR_FORMAT \n     $MSG_FORMAT: $PROG image [ img | diff ]" && exit 1
32
33if [ "$USER" != "root" ]; then
34        echo "$PROG: Error: solo ejecutable por root" >&2
35        exit 1
36fi
37
38[ "$2" == "" ] && IMGEXT="img" || IMGEXT="$2"
39# Comprobamos que imagen la imagen esta montada
40MOUNTDIR="$REPODIR/mount/$1"
41[ "$IMGEXT" == "diff" ] && MOUNTDIR="$MOUNTDIR.$IMGEXT"
42[ ! -r $MOUNTDIR/ogimg.info ] && echo "La imagen REPO $1 $2 no esta montada" && exit 0
43
44echo -ne UMOUNT_IMAGE "$1" $IMGEXT | /opt/opengnsys/sbin/ogAdmRepoAux
45echo "Los resultado se registran en $REPOLOG. "
Note: See TracBrowser for help on using the repository browser.