summaryrefslogtreecommitdiffstats
path: root/client/shared/etc/preinit/poweroff.sh
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2011-12-22 13:38:11 +0000
committerramon <ramongomez@us.es>2011-12-22 13:38:11 +0000
commitc3c7cb3ae6f6600223111a572050f34f2df6fa71 (patch)
tree96fce1db6bf64fee2845d3a48abcbe07d9937562 /client/shared/etc/preinit/poweroff.sh
parent4caea352de0d0a19d4e0a2e2dd04980dd28e6be0 (diff)
Congelar versión 1.0.2 en tags/opengnsys-1.0.2 (modifica #446).opengnsys-1.0.2
git-svn-id: https://opengnsys.es/svn/tags/opengnsys-1.0.2@2405 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/shared/etc/preinit/poweroff.sh')
-rwxr-xr-xclient/shared/etc/preinit/poweroff.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/client/shared/etc/preinit/poweroff.sh b/client/shared/etc/preinit/poweroff.sh
new file mode 100755
index 00000000..9e7d700d
--- /dev/null
+++ b/client/shared/etc/preinit/poweroff.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+#/**
+#@file poweroff.sh
+#@brief Script de inicio para cargar el proceso comprobación de clientes inactivos.
+#@note Arranca y configura el proceso "cron".
+#@warning License: GNU GPLv3+
+#@version 1.0.2
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2011-10-25
+#*/
+
+
+# Si está configurado OpenGnSys ...
+if [ -n "$OPENGNSYS" ]; then
+ #echo "$MSG_POWEROFFCONF"
+
+ # Crear fichero de configuración por defecto (30 min. de espera).
+ POWEROFFCONF=/etc/poweroff.conf
+ cat << FIN > $POWEROFFCONF
+POWEROFFSLEEP=30
+POWEROFFTIME=
+FIN
+
+ # Lanzar el proceso "cron".
+ cron -l
+
+ # Definir la "crontab" lanzando el proceso de comprobación cada minuto.
+ echo "* * * * * [ -x $OGBIN/poweroffconf ] && $OGBIN/poweroffconf" | crontab -
+
+else
+ # FIXME Error: entorno de OpenGnSys no configurado.
+ echo "Error: OpenGnSys environment is not configured." # FIXME: definir mensaje.
+ exit 1
+fi
+