From 2ddcc6c972a9879a527b1733e9b1fc2d6eac5aa8 Mon Sep 17 00:00:00 2001 From: Alan Kennedy Date: Sun, 24 Oct 2004 06:04:48 +0000 Subject: [PATCH] Ya utiliza el antifraude.conf --- inst/antifraude.pl | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/inst/antifraude.pl b/inst/antifraude.pl index cdb843d..3e9a9f0 100644 --- a/inst/antifraude.pl +++ b/inst/antifraude.pl @@ -64,7 +64,8 @@ sub getConfVar { do { $line = } until $. == $linenumber; close(CONFIGFILE); chop($line); - ($confvar = $line) =~ s/^.*= (.*)/$1/; + ($confvar = $line) =~ s/"(.*)"$/$1/; + $confvar =~ s/^.*=//; return $confvar; } @@ -156,24 +157,16 @@ sub checkUmbrales { } # --------- MAIN CODE -------- # -# En la version final, recibo por param el directorio del .conf, por ahora -# recibo un dir donde tengo archivos de llamadas -if ((!$ARGV[0]) || (! -d $ARGV[0])) { - print("No se ha ingresado un directorio fuente de llamadas\n"); - exit 1; -} - # File locking.. if (is_lock()) { exit 1; } lock(); # Defino some GLOBALS -$CONFDIR = shift; -$CONFDATA{logdir} = getConfVar("$CONFDIR/afinstal.conf",12); -$CONFDATA{logfile} = getConfVar("$CONFDIR/afinstal.conf",13); -$CONFDATA{logsize} = getConfVar("$CONFDIR/afinstal.conf",14); -$CONFDATA{datadir} = getConfVar("$CONFDIR/afinstal.conf",15); -$CONFDATA{alarmlog} = "$CONFDIR/alarmas/alarmas.txt"; +$CONFDIR = "$ENV{'HOME'}/.antifraude"; +$CONFDATA{logdir} = getConfVar("$CONFDIR/conf/antifraude.conf",2); +$CONFDATA{logfile} = getConfVar("$CONFDIR/conf/antifraude.conf",3); +$CONFDATA{logsize} = getConfVar("$CONFDIR/conf/antifraude.conf",4); +$CONFDATA{datadir} = getConfVar("$CONFDIR/conf/antifraude.conf",5); # Cargo los UMBRALES en memoria open(PARAMFILE,"$CONFDIR/umbrales.param") or die "No se pudo abrir el archivo de umbrales"; -- 2.43.0