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
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 ... |
---|
14 | if [ -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 |
---|
23 | POWEROFFSLEEP=30 |
---|
24 | POWEROFFTIME= |
---|
25 | FIN |
---|
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 | |
---|
35 | else |
---|
36 | # FIXME Error: entorno de OpenGnsys no configurado. |
---|
37 | echo "Error: OpenGnsys environment is not configured." # FIXME: definir mensaje. |
---|
38 | exit 1 |
---|
39 | fi |
---|
40 | |
---|
Note: See
TracBrowser
for help on using the repository browser.