source: client/shared/etc/preinit/poweroff.sh @ d7fe54a

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 d7fe54a was 5bfead0, checked in by ramon <ramongomez@…>, 8 years ago

#730: Sustitución del nombre del proyecto en el resto de ficheros del cliente.

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

  • Property mode set to 100755
File size: 1.2 KB
Line 
1#!/bin/bash
2#/**
3#@file    poweroff.sh
4#@brief   Script de inicio para cargar el proceso comprobación de clientes inactivos.
5#@note    Arranca y configura el proceso "cron".
6#@warning License: GNU GPLv3+
7#@version 1.0.2
8#@author  Ramon Gomez, ETSII Universidad de Sevilla
9#@date    2011-10-25
10#*/
11
12
13# Si está configurado OpenGnsys ...
14if [ -n "$OPENGNSYS" ]; then
15    echo "${MSG_POWEROFFCONF:-.}"
16
17    # Sincronización horaria con servidor NTP.
18    [ -n "$ogntp" -a "$status" != "offline" ] && ntpdate $ogntp
19
20    # Crear fichero de configuración por defecto (30 min. de espera).
21    POWEROFFCONF=/etc/poweroff.conf
22    cat << FIN > $POWEROFFCONF
23POWEROFFSLEEP=30
24POWEROFFTIME=
25FIN
26    # Incluir zona horaria en el fichero de configuración.
27    awk 'BEGIN {RS=" "} /^TZ=/ {print}' /proc/cmdline >> $POWEROFFCONF
28
29    # Lanzar el proceso "cron".
30    cron -l
31
32    # Definir la "crontab" lanzando el proceso de comprobación cada minuto.
33    echo "* * * * *   [ -x $OGBIN/poweroffconf ] && $OGBIN/poweroffconf" | crontab -
34
35else
36    # FIXME Error: entorno de OpenGnsys no configurado.
37    echo "Error: OpenGnsys environment is not configured."   # FIXME: definir mensaje.
38    exit 1
39fi
40
Note: See TracBrowser for help on using the repository browser.