Versión 1.0: Modificado script de interfaz web para crear imagen desde cliente en modo no administrador.
Modificado #291. git-svn-id: https://opengnsys.es/svn/branches/version1.0@1628 a21b9725-9963-47de-94b9-378ad31fedc9remotes/github/debian-pkg
parent
74e4526be1
commit
f6c1d2b90d
|
@ -1,32 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
#_______________________________________________________________________________________________________________________________
|
||||
#___________________________________________________
|
||||
#
|
||||
# PARAMETROS RECIBIDOS DESDE EL CLIENTE:
|
||||
# $1 disco
|
||||
# $2 par=N<>mero de particion
|
||||
# $3 Nombre can<61>nico de la imagen
|
||||
# $4 Direcci<63>n del repositorio
|
||||
#_______________________________________________________________________________________________________________________________
|
||||
echo $* >> $OGLOGFILE
|
||||
# $1 Número de disco
|
||||
# $2 Número de particion
|
||||
# $3 Nombre canónico de la imagen (sin extensión)
|
||||
# $4 Dirección del repositorio (REPO, por defecto)
|
||||
#___________________________________________________
|
||||
|
||||
umount /opt/opengnsys/images
|
||||
# Registro de ejecución
|
||||
echo $* >> $OGLOGFILE
|
||||
|
||||
if [ "$ogprotocol" == "nfs" ]
|
||||
then
|
||||
mount.nfs ${ROOTSERVER}:/opt/opengnsys/images /opt/opengnsys/images -o nolock
|
||||
fi
|
||||
|
||||
if [ "$ogprotocol" == "smb" ]
|
||||
then
|
||||
echo "montando smb"
|
||||
mount.cifs //${ROOTSERVER}/ogimages /opt/opengnsys/images -o user=opengnsys,pass=og
|
||||
# Solo ejecutable por OpenGnSys Client.
|
||||
PATH=$PATH:$(dirname $0)
|
||||
PROG=$(basename $0)
|
||||
CALLER=$(ogGetCaller)
|
||||
if [ "$CALLER" != "ogAdmClient" ]; then
|
||||
ogRaiseError $OG_ERR_NOTEXEC "$CALLER -> $PROG"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ -f createImage$ogengine ]
|
||||
then
|
||||
createImage$ogengine "$1" "$2" "REPO" "$3" &>> $OGLOGFILE || exit $?
|
||||
# Valor por defecto para el repositorio.
|
||||
REPO=${4:-"repo"}
|
||||
|
||||
# Si cleinte no está en modo "admin"; activar repositorio para escritura,
|
||||
# crear imagen y activar para lectura.
|
||||
[ "$boot" != "admin" ] && CambiarAcceso admin
|
||||
if [ -f createImage$ogengine ]; then
|
||||
createImage$ogengine "$1" "$2" "$REPO" "$3" &>> $OGLOGFILE
|
||||
else
|
||||
createImage "$1" "$2" "REPO" "$3" &>> $OGLOGFILE || exit $?
|
||||
createImage "$1" "$2" "$REPO" "$3" &>> $OGLOGFILE
|
||||
fi
|
||||
RETVAL=$?
|
||||
[ "$boot" != "admin" ] && CambiarAcceso user
|
||||
exit $RETVAL
|
||||
|
||||
|
|
|
@ -971,6 +971,8 @@ function copyInterfaceAdm ()
|
|||
echoAndLog "${FUNCNAME}(): error while copying Administration Interface Folder"
|
||||
hayErrores=1
|
||||
fi
|
||||
chown root:root $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
|
||||
chmod 700 $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
|
||||
|
||||
return $hayErrores
|
||||
}
|
||||
|
|
|
@ -275,6 +275,8 @@ function updateInterfaceAdm ()
|
|||
exit 1
|
||||
fi
|
||||
chmod -R +x $INSTALL_TARGET/client/interfaceAdm
|
||||
chown root:root $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
|
||||
chmod 700 $INSTALL_TARGET/client/interfaceAdm/CambiarAcceso
|
||||
echoAndLog "${FUNCNAME}(): Admin interface updated successfully."
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue