summaryrefslogtreecommitdiffstats
path: root/admin/Interface/EjecutarScript
blob: 1295885c9fcf20b69b90d31804d0234ed2f66671 (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
35
36
37
38
39
40
41
42
43
#!/bin/bash
TIME1=$SECONDS


#Load engine configurator from engine.cfg file.
#Carga el configurador del engine desde el fichero engine.cfg
[ -z $OGENGINECONFIGURATE ] && source /opt/opengnsys/etc/engine.cfg

# Clear temporary file used as log track by httpdlog
# Limpia los ficheros temporales usados como log de seguimiento para httpdlog
echo " " > $OGLOGSESSION; echo " " > $OGLOGCOMMAND; echo " " > ${OGLOGCOMMAND}.tmp

# Registro de inicio de ejecución
#echo "[START Interface ] Run this command: $0 $*" | tee -a $OGLOGSESSION $OGLOGFILE
echo "$MSG_INTERFACE_START $0 $*" | tee -a $OGLOGSESSION $OGLOGFILE

echo "Instrucciones a ejecutar: *****************************" >>  $OGLOGFILE
cat  $1 >> $OGLOGFILE


echo "Salida de las instrucciones: *****************************" >>  $OGLOGFILE
chmod +x $1
$1 &>> $OGLOGCOMMAND
RETVAL=$?



TIME=$[SECONDS-TIME1]
if [ $RETVAL == 0 ]
then
	echo "[100] Duracion de la operacion $[TIME/60]m $[TIME%60]s" | tee -a $OGLOGSESSION $OGLOGFILE
else
	echo "ERROR no operacion no realizada" | tee -a $OGLOGSESSION $OGLOGFILE
fi


# Registro de fin de ejecución
#echo "[END Interface] Command finished with this code:  $RETVAL" | tee -a $OGLOGSESSION $OGLOGFILE
echo "$MSG_INTERFACE_END $RETVAL" | tee -a $OGLOGSESSION $OGLOGFILE



exit $RETVAL