blob: 5c20499aec8929ab139ed9e67563ea769001cd89 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/bin/bash
#/**
#@file mountrepo.sh
#@brief Script para montar el repositorio de datos remoto.
#@warning License: GNU GPLv3+
#@version 1.0
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2011-03-17
#*/
OGIMG=${OGIMG:-/opt/opengnsys/images}
ROOTREPO=${ROOTREPO:-"$ROOTSERVER"}
# TODO Revisar proceso de arranque para no montar 2 veces el repositorio.
if [ $ogactiveadmin == "true" ]; then
export boot=admin
umount $OGIMG 2>/dev/null
protocol=${potocol:-"smb"}
printf "$MSG_MOUNTREPO\n" "$protocol" "$boot"
case "$protocol" in
nfs) mount.nfs ${ROOTREPO}:$OGIMG $OGIMG -o rw,nolock ;;
smb) PASS=$(grep "^[ ]*\(export \)\?OPTIONS=" /scripts/ogfunctions 2>&1 | \
sed 's/\(.*\)pass=\(\w*\)\(.*\)/\2/')
PASS=${PASS:-"og"}
mount.cifs //${ROOTREPO}/ogimages $OGIMG -o rw,serverino,acl,username=opengnsys,password=$PASS
;;
esac
fi
|