diff options
author | irina <irinagomez@us.es> | 2015-11-25 10:46:08 +0000 |
---|---|---|
committer | irina <irinagomez@us.es> | 2015-11-25 10:46:08 +0000 |
commit | 4ceafc1420f2d80e84af62f188747d632c2496c5 (patch) | |
tree | 4227bc0c0f2cdab6929723da9595a365ba81d2bc /admin/Interface/CrearImagen | |
parent | d4bff1aff781b7c3de85a8af1cd8b6bfa68959cf (diff) |
#679 Varios repos: crear imagen permite elegir el repositorio de destino de la imagen
git-svn-id: https://opengnsys.es/svn/branches/version1.1@4745 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/Interface/CrearImagen')
-rwxr-xr-x | admin/Interface/CrearImagen | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/admin/Interface/CrearImagen b/admin/Interface/CrearImagen index c3fa9b45..d7d1edc3 100755 --- a/admin/Interface/CrearImagen +++ b/admin/Interface/CrearImagen @@ -53,9 +53,14 @@ fi # Valor por defecto para el repositorio. REPO=${4:-"REPO"} -[ "$REPO" == "$(ogGetRepoIp)" ] && REPO="REPO" [ "$REPO" == "$(ogGetIpAddress)" ] && REPO="CACHE" -[ "$REPO" == "CACHE" ] && REPO="CACHE" +# Si es una ip y es distinta a la del recurso samba cambiamos de REPO. +ogCheckIpAddress $REPO +if [ $? == 0 -o $REPO == "REPO" ] ; then + # Si falla el cambio -> salimos con error repositorio no valido + ogChangeRepo $REPO || exit $(ogRaiseError $OG_ERR_NOTFOUND '$REPO'; echo $?) + REPO="REPO" +fi # Si el destino es REPO y el cliente no está en modo "admin"; activar repositorio para escritura, if [ "$REPO" == "REPO" -a "$boot" != "admin" ] @@ -65,11 +70,12 @@ then [ $RETVAL -gt 0 ] && exit $RETVAL fi +ogEcho createImage "$1" "$2" "$4" /"$3" # Si existe, ejecuta script personalizado "createImageCustom"; si no, llama al genérico "createImage". if which createImageCustom &>/dev/null; then - createImageCustom "$1" "$2" "$REPO" /"$3" &>> $OGLOGCOMMAND + createImageCustom "$1" "$2" "$4" /"$3" &>> $OGLOGCOMMAND else - createImage "$1" "$2" "$REPO" /"$3" &>> $OGLOGCOMMAND + createImage "$1" "$2" "$4" /"$3" &>> $OGLOGCOMMAND fi RETVAL=$? |