summaryrefslogtreecommitdiffstats
path: root/client/shared/etc/init/default.sh
blob: 7b443e23ca41ae07cfd8d312bff293567ca3fd04 (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
31
32
33
34
#!/bin/bash
# Proceso general de arranque de OpenGnSys Client.


# Fichero de registro de incidencias (en el servidor; si no, en local).
OPENGNSYS=${OPENGNSYS:-/opt/opengnsys}
OGLOGFILE=${OGLOGFILE:-$OPENGNSYS/log/$(ogGetIpAdderss).log}
if ! touch $OGLOGFILE 2>/dev/null; then
    OGLOGFILE=/var/log/opengnsys.log
fi
LOGLEVEL=5

# Matando plymount para inicir browser o shell
pkill -9 plymouthd

# Arranque de OpenGnSys Client daemon (web services).
if [ -x $OPENGNSYS/job_executer/init.d/job_executer ]; then
    echo "Running Opengnsys client daemon (web services)"
    $OPENGNSYS/job_executer/init.d/job_executer restart
fi

# Arranque de OpenGnSys Client daemon (socket).
if [ -x "$OPENGNSYS/bin/ogAdmClient" ]; then
    echo "${MSG_LAUNCHCLIENT:-.}"
    [ $ogactiveadmin == "true" ] && boot="admin"
    $OPENGNSYS/bin/ogAdmClient -f $OPENGNSYS/etc/ogAdmClient.cfg -l $OGLOGFILE -d $LOGLEVEL
fi

# Si fallo en cliente y modo "admin", cargar shell; si no, salir.
if [ "$boot" == "admin" ]; then
    bash
fi