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-instalacion
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 | #*/ ## |
---|
13 | BASEDIR=/opt/opengnsys |
---|
14 | REPODIR="$BASEDIR/images" |
---|
15 | REPOLOG=$BASEDIR/log/ogAdmRepo.log |
---|
16 | # Cargamos los mensajes en el idioma del sistema. |
---|
17 | # Comprobamos que el fichero de idioma existe. Si no "es_ES" por defecto. |
---|
18 | ls $BASEDIR/client/etc/lang.$LANG.conf &>/dev/null |
---|
19 | [ $? -eq 0 ] || LANG="es_ES" |
---|
20 | |
---|
21 | source $BASEDIR/client/etc/lang.$LANG.conf |
---|
22 | |
---|
23 | PROG="$(basename $0)" |
---|
24 | # Si se solicita, mostrar ayuda. |
---|
25 | if [ "$*" == "help" ]; then |
---|
26 | echo -e " $PROG: $MSG_HELP_ogUnmountImage \n" \ |
---|
27 | "$MSG_FORMAT: $PROG nombre_image [ img|diff ] \n" \ |
---|
28 | "base -> $PROG Windows7 \n" \ |
---|
29 | "diff -> $PROG Ubuntu12 diff" |
---|
30 | exit 0 |
---|
31 | fi |
---|
32 | |
---|
33 | [ $# -lt 1 ] && echo -e "$PROG: Error: $MSG_ERR_FORMAT \n $MSG_FORMAT: $PROG image [ img | diff ]" && exit 1 |
---|
34 | |
---|
35 | if [ "$USER" != "root" ]; then |
---|
36 | echo "$PROG: Error: solo ejecutable por root" >&2 |
---|
37 | exit 1 |
---|
38 | fi |
---|
39 | |
---|
40 | # Comprobamos que imagen la imagen esta montada |
---|
41 | MOUNTDIR="$REPODIR/mount/$1" |
---|
42 | if [ "$2" == "diff" ]; then |
---|
43 | IMGEXT="diff" |
---|
44 | MOUNTDIR="$MOUNTDIR.diff" |
---|
45 | else |
---|
46 | IMGEXT="img" |
---|
47 | fi |
---|
48 | # Si la imaen no está montada me salgo |
---|
49 | df |grep "$MOUNTDIR$" 2>&1 >/dev/null || exit 0 |
---|
50 | |
---|
51 | echo -ne UMOUNT_IMAGE "$1" $IMGEXT | /opt/opengnsys/sbin/ogAdmRepoAux |
---|
52 | echo "Los resultado se registran en $REPOLOG. " |
---|
Note: See
TracBrowser
for help on using the repository browser.