source: server/bin/unmountimage @ be48687

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

#565 correccion de comentarios de los comandos para las imagenes sincronizables

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

  • Property mode set to 100755
File size: 1.3 KB
Line 
1#!/bin/bash
2#/**
3#        unmountimage
4#@brief  Desmonta imagen sincronizable
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#@version 1.0 - Desmontar imagen sincronizable
10#@author  Irina Gomez
11#@date   2013-05-23
12#*/ ##
13BASEDIR=/opt/opengnsys
14REPODIR="$BASEDIR/images"
15REPOLOG=$BASEDIR/log/ogAdmRepo.log
16source $BASEDIR/client/etc/lang.$LANG.conf
17
18PROG="$(basename $0)"
19# Si se solicita, mostrar ayuda.
20if [ "$*" == "help" ]; then
21    echo -e " $PROG: $MSG_HELP_ogUnmountImage \n" \
22            "$MSG_FORMAT: $PROG nombre_image [ img|diff ] \n" \
23            "base -> $PROG Windows7 \n" \
24            "diff -> $PROG Ubuntu12 diff"
25   exit 0
26fi
27
28[ $# -lt 1 ] && echo -e "$PROG: Error: $MSG_ERR_FORMAT \n     $MSG_FORMAT: $PROG image [ img | diff ]" && exit 1
29
30if [ "$USER" != "root" ]; then
31        echo "$PROG: Error: solo ejecutable por root" >&2
32        exit 1
33fi
34
35[ "$2" == "" ] && IMGEXT="img" || IMGEXT="$2"
36# Comprobamos que imagen la imagen esta montada
37MOUNTDIR="$REPODIR/mount/$1"
38[ "$IMGEXT" == "diff" ] && MOUNTDIR="$MOUNTDIR.$IMGEXT"
39[ ! -r $MOUNTDIR/ogimg.info ] && echo "La imagen REPO $1 $2 no esta montada" && exit 0
40
41echo -ne UMOUNT_IMAGE "$1" $IMGEXT | /opt/opengnsys/sbin/ogAdmRepoAux
42echo "Los resultado se registran en $REPOLOG. "
Note: See TracBrowser for help on using the repository browser.