diff options
author | irina <irinagomez@us.es> | 2017-11-08 13:22:41 +0000 |
---|---|---|
committer | irina <irinagomez@us.es> | 2017-11-08 13:22:41 +0000 |
commit | 744ecd6404213903f08b712aa4fac5ea19fa3201 (patch) | |
tree | 3ceab32680e6accc72a7a7f3bff9a1ffacc0cb7a /repoman/bin/unmountimage | |
parent | 043e67df0eb136868ca7d5852e9753026cb23bb8 (diff) |
#770 Script de servidor sincronizadas: si no existe fichero de idioma toma por defecto el castellano.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5503 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'repoman/bin/unmountimage')
-rwxr-xr-x | repoman/bin/unmountimage | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/repoman/bin/unmountimage b/repoman/bin/unmountimage new file mode 100755 index 00000000..031ae9ee --- /dev/null +++ b/repoman/bin/unmountimage @@ -0,0 +1,52 @@ +#!/bin/bash +#/** +# unmountimage +#@brief Desmonta imagen sincronizable +#@param 1 imagen +#@param 2 extension [ img|diff ] opcional, por defecto img +#@return +#@exception OG_ERR_FORMAT # 1 formato incorrecto. +#@version 1.0 - Desmontar imagen sincronizable +#@author Irina Gomez +#@date 2013-05-23 +#*/ ## +BASEDIR=/opt/opengnsys +REPODIR="$BASEDIR/images" +REPOLOG=$BASEDIR/log/ogAdmRepo.log +# Cargamos los mensajes en el idioma del sistema. +# Comprobamos que el fichero de idioma existe. Si no "es_ES" por defecto. +ls $BASEDIR/client/etc/lang.$LANG.conf &>/dev/null +[ $? -eq 0 ] || LANG="es_ES" + +source $BASEDIR/client/etc/lang.$LANG.conf + +PROG="$(basename $0)" +# Si se solicita, mostrar ayuda. +if [ "$*" == "help" ]; then + echo -e " $PROG: $MSG_HELP_ogUnmountImage \n" \ + "$MSG_FORMAT: $PROG nombre_image [ img|diff ] \n" \ + "base -> $PROG Windows7 \n" \ + "diff -> $PROG Ubuntu12 diff" + exit 0 +fi + +[ $# -lt 1 ] && echo -e "$PROG: Error: $MSG_ERR_FORMAT \n $MSG_FORMAT: $PROG image [ img | diff ]" && exit 1 + +if [ "$USER" != "root" ]; then + echo "$PROG: Error: solo ejecutable por root" >&2 + exit 1 +fi + +# Comprobamos que imagen la imagen esta montada +MOUNTDIR="$REPODIR/mount/$1" +if [ "$2" == "diff" ]; then + IMGEXT="diff" + MOUNTDIR="$MOUNTDIR.diff" +else + IMGEXT="img" +fi +# Si la imaen no está montada me salgo +df |grep "$MOUNTDIR$" 2>&1 >/dev/null || exit 0 + +echo -ne UMOUNT_IMAGE "$1" $IMGEXT | /opt/opengnsys/sbin/ogAdmRepoAux +echo "Los resultado se registran en $REPOLOG. " |