configure-oglivelgromero-new-oglivemainmount-efivarfsuse-local-agent-oglivevarios-instalacion
Last change
on this file since b44a429 was
d65dcba,
checked in by Natalia Serrano <natalia.serrano@…>, 7 months ago
|
refs #924 remove ogGetCaller checks
|
-
Property mode set to
100755
|
File size:
1.5 KB
|
Rev | Line | |
---|
[6905c2a7] | 1 | #!/bin/bash |
---|
| 2 | |
---|
[4dac6a3] | 3 | #______________________________________ |
---|
[6905c2a7] | 4 | # |
---|
| 5 | # PARAMETROS RECIBIDOS DESDE EL CLIENTE |
---|
| 6 | # $1 modo (admin, user) |
---|
[4dac6a3] | 7 | #______________________________________ |
---|
[6905c2a7] | 8 | |
---|
[d7fe54a] | 9 | # Error si llamada no se realliza desde OpenGnsys Client. |
---|
[6905c2a7] | 10 | PROG=$(basename $0) |
---|
[d65dcba] | 11 | #CALLER=$(ogGetCaller) |
---|
| 12 | #if ! $(ogCheckStringInGroup "$CALLER" "CrearImagen ConsolaRemota CrearImagenBasica CrearSoftIncremental"); then |
---|
| 13 | # ogRaiseError $OG_ERR_NOTEXEC "$CALLER -> $PROG" |
---|
| 14 | # exit $? |
---|
| 15 | #fi |
---|
[6905c2a7] | 16 | |
---|
[4dac6a3] | 17 | # Salir si el repositorio está bloquedo (tiene ficheros abiertos). |
---|
[6905c2a7] | 18 | REPOIP=$(ogGetRepoIp) |
---|
| 19 | if [ -z "$REPOIP" ]; then |
---|
| 20 | ogRaiseError $OG_ERR_NOTFOUND "repo no montado" |
---|
| 21 | exit $? |
---|
| 22 | fi |
---|
| 23 | if ogIsRepoLocked; then |
---|
| 24 | ogRaiseError $OG_ERR_LOCKED "repo $REPOIP" |
---|
| 25 | exit $? |
---|
| 26 | fi |
---|
| 27 | |
---|
| 28 | # Comprobar protocolo y modo de acceso. |
---|
[16919ef] | 29 | PROTO=${ogprotocol:-"smb"} |
---|
| 30 | case "$PROTO" in |
---|
[6905c2a7] | 31 | nfs|smb) ;; |
---|
[16919ef] | 32 | *) ogRaiseError $OG_ERR_FORMAT "protocolo desconocido $PROTO" |
---|
[6905c2a7] | 33 | exit $? ;; |
---|
| 34 | esac |
---|
| 35 | case "$1" in |
---|
[256bc1e] | 36 | admin) MODE="rw" ;; |
---|
| 37 | user) MODE="ro" ;; |
---|
[6905c2a7] | 38 | *) ogRaiseError $OG_ERR_FORMAT "modo desconocido $1" |
---|
| 39 | exit $? ;; |
---|
| 40 | esac |
---|
| 41 | |
---|
| 42 | # Desmontar repositorio y volver a montarlo con el modo adecuado. |
---|
| 43 | umount $OGIMG |
---|
[79a4175] | 44 | # Unidad organizativa |
---|
| 45 | [ "$ogunit" != "" ] && OGUNIT="/$ogunit" |
---|
[1222e988] | 46 | ogEcho info "$PROG: Montar repositorio $REPO por $PROTO en modo $1" |
---|
[16919ef] | 47 | case "$PROTO" in |
---|
[79a4175] | 48 | nfs) mount -t nfs $REPOIP:$OGIMG$OGUNIT $OGIMG -o $MODE ;; |
---|
[1c53cef] | 49 | smb) PASS=$(grep "^[ ]*\(export \)\?OPTIONS=" /scripts/ogfunctions 2>&1 | \ |
---|
| 50 | sed 's/\(.*\)pass=\(\w*\)\(.*\)/\2/') |
---|
| 51 | PASS=${PASS:-"og"} |
---|
[79a4175] | 52 | mount.cifs //$REPOIP/ogimages$OGUNIT $OGIMG -o $MODE,serverino,acl,username=opengnsys,password=$PASS |
---|
[4dac6a3] | 53 | esac |
---|
| 54 | |
---|
Note: See
TracBrowser
for help on using the repository browser.