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
Rev | Line | |
---|
[8361974] | 1 | #!/bin/bash |
---|
| 2 | #/** |
---|
[288b716] | 3 | # unmountimage |
---|
| 4 | #@brief Desmonta imagen sincronizable |
---|
[8361974] | 5 | #@param 1 imagen |
---|
| 6 | #@param 2 extension [ img|diff ] opcional, por defecto img |
---|
| 7 | #@return |
---|
| 8 | #@exception OG_ERR_FORMAT # 1 formato incorrecto. |
---|
[288b716] | 9 | #@version 1.0 - Desmontar imagen sincronizable |
---|
[8361974] | 10 | #@author Irina Gomez |
---|
[288b716] | 11 | #@date 2013-05-23 |
---|
[8361974] | 12 | #*/ ## |
---|
| 13 | BASEDIR=/opt/opengnsys |
---|
| 14 | REPODIR="$BASEDIR/images" |
---|
| 15 | REPOLOG=$BASEDIR/log/ogAdmRepo.log |
---|
| 16 | source $BASEDIR/client/etc/lang.$LANG.conf |
---|
| 17 | |
---|
| 18 | PROG="$(basename $0)" |
---|
| 19 | # Si se solicita, mostrar ayuda. |
---|
| 20 | if [ "$*" == "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 |
---|
| 26 | fi |
---|
| 27 | |
---|
| 28 | [ $# -lt 1 ] && echo -e "$PROG: Error: $MSG_ERR_FORMAT \n $MSG_FORMAT: $PROG image [ img | diff ]" && exit 1 |
---|
| 29 | |
---|
| 30 | if [ "$USER" != "root" ]; then |
---|
| 31 | echo "$PROG: Error: solo ejecutable por root" >&2 |
---|
| 32 | exit 1 |
---|
| 33 | fi |
---|
| 34 | |
---|
| 35 | # Comprobamos que imagen la imagen esta montada |
---|
| 36 | MOUNTDIR="$REPODIR/mount/$1" |
---|
[f456755] | 37 | if [ "$2" == "diff" ]; then |
---|
| 38 | IMGEXT="diff" |
---|
| 39 | MOUNTDIR="$MOUNTDIR.diff" |
---|
| 40 | else |
---|
| 41 | IMGEXT="img" |
---|
| 42 | fi |
---|
| 43 | # Si la imaen no está montada me salgo |
---|
| 44 | df |grep "$MOUNTDIR$" 2>&1 >/dev/null || exit 0 |
---|
[8361974] | 45 | |
---|
| 46 | echo -ne UMOUNT_IMAGE "$1" $IMGEXT | /opt/opengnsys/sbin/ogAdmRepoAux |
---|
| 47 | echo "Los resultado se registran en $REPOLOG. " |
---|
Note: See
TracBrowser
for help on using the repository browser.