source: server/bin/unmountimage @ 70c429f

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

#565 adaptacion diferenciales al cliente 1.0.4., extension diferenciles img.diff

git-svn-id: https://opengnsys.es/svn/branches/version1.0@4059 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# Comprobamos que imagen la imagen esta montada
36MOUNTDIR="$REPODIR/mount/$1"
37if [ "$2" == "diff" ]; then
38        IMGEXT="diff"
39        MOUNTDIR="$MOUNTDIR.diff"
40else
41        IMGEXT="img"
42fi
43# Si la imaen no está montada me salgo
44df |grep "$MOUNTDIR$"  2>&1 >/dev/null || exit 0
45
46echo -ne UMOUNT_IMAGE "$1" $IMGEXT | /opt/opengnsys/sbin/ogAdmRepoAux
47echo "Los resultado se registran en $REPOLOG. "
Note: See TracBrowser for help on using the repository browser.