source: admin/Interface/CambiarAcceso @ 45b36c0

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
Last change on this file since 45b36c0 was 45b36c0, checked in by ramon <ramongomez@…>, 14 years ago

Versión 1.0.2: Actualizar lista de cambios previsto; corrección de erratas y limpieza (modifica #446).

git-svn-id: https://opengnsys.es/svn/branches/version1.0@2366 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100755
File size: 1.4 KB
Line 
1#!/bin/bash
2
3#______________________________________
4#
5# PARAMETROS RECIBIDOS DESDE EL CLIENTE
6# $1 modo  (admin, user)
7#______________________________________
8
9# Error si llamada no se realliza desde OpenGnSys Client.
10PROG=$(basename $0)
11CALLER=$(ogGetCaller)
12if [ "$CALLER" != "CrearImagen" -a "$CALLER" != "ConsolaRemota" ]; then
13    ogRaiseError $OG_ERR_NOTEXEC "$CALLER -> $PROG"
14    exit $?
15fi
16
17# Salir si el repositorio está bloquedo (tiene ficheros abiertos).
18REPOIP=$(ogGetRepoIp)
19if [ -z "$REPOIP" ]; then
20        ogRaiseError $OG_ERR_NOTFOUND "repo no montado"
21        exit $?
22fi
23if ogIsRepoLocked; then
24        ogRaiseError $OG_ERR_LOCKED "repo $REPOIP"
25        exit $?
26fi
27
28# Comprobar protocolo y modo de acceso.
29PROTO=${ogprotocol:-"smb"}
30case "$PROTO" in
31        nfs|smb) ;;
32        *)      ogRaiseError $OG_ERR_FORMAT "protocolo desconocido $PROTO"
33                exit $? ;;
34esac
35case "$1" in
36        admin)  MODE="rw,nolock" ;;
37        user)   MODE="ro,nolock" ;;
38        *)      ogRaiseError $OG_ERR_FORMAT "modo desconocido $1"
39                exit $? ;;
40esac
41
42# Desmontar repositorio y volver a montarlo con el modo adecuado.
43umount $OGIMG
44ogEcho info "$PROG: Montar repositorio $REPO por $PROTO en modo $1"
45MNTOPTS="$(awk -F\" '$1~/OPTIONS=$/ {print $2;}' /scripts/ogfunctions 2>/dev/null)"
46MNTOPTS=${MNTOPTS:-"-o username=opengnsys,password=og"}
47case "$PROTO" in
48        nfs)    mount -t nfs $REPOIP:$OGIMG $OGIMG -o $MODE ;;
49        smb)    mount -t cifs //$REPOIP/ogimages $OGIMG $MNTOPTS,$MODE,serverino,acl ;;
50esac
51
Note: See TracBrowser for help on using the repository browser.