source: client/shared/etc/preinit/poweroff.sh @ 5b825b50

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 5b825b50 was d4bff1a, checked in by ramon <ramongomez@…>, 9 years ago

#725: Si se define NTP, la sincronización se hace en la configuración de ahorro de energía (en vez de en la carga del entorno) y se incluye la zona horaria en la comprobación cronológica de apagado.

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

  • Property mode set to 100755
File size: 1.2 KB
RevLine 
[3c66d00]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
[c39fac3]15    echo "${MSG_POWEROFFCONF:-.}"
[3c66d00]16
[d4bff1a]17    # Sincronización horaria con servidor NTP.
18    [ -n "$ogntp" -a "$status" != "offline" ] && ntpdate $ogntp
19
[3c66d00]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
[d4bff1a]26    # Incluir zona horaria en el fichero de configuración.
27    awk 'BEGIN {RS=" "} /^TZ=/ {print}' /proc/cmdline >> $POWEROFFCONF
[3c66d00]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.