INSTDIR="${CURRDIR}/inst"
CONFFILE="${CONFDIR}/afinstal.conf"
DEFAULTDIR=$CURRDIR
+OWNCONFDIR="$HOME/.antifraude"
havemonio=0
haveconf=0
havefraude=0
echo "" >> $CONFFILE
done
fi
+if [ ! -f "$OWNCONFDIR" ]; then
+ mkdir -p "$OWNCONFDIR"
+fi
+if [ ! -f "$OWNCONFDIR/lock" ]; then
+ mkdir -p "$OWNCONFDIR/lock"
+fi
+if [ ! -f "$OWNCONFDIR/conf" ]; then
+ mkdir -p "$OWNCONFDIR/conf"
+fi
# Comienzo la instalacion de cada componente
comandos=`echo $toinstall | sed s%,%" "%g`
echo ">> Creando Estructura de Directorio...."
mkdir -p "$BINDIR"
mkdir -p "$LOGDIR"
- mkdir -p "$CONFDIR/lock"
touch "$LOGDIR/$LOGFILE"
if [ "$comando" = "antifraude.pl" ]; then
cp "$INSTDIR/$comando" "$BINDIR"
chmod u+x "$BINDIR/$comando"
- # TODO : no se debe copiar solo 1 vez?
- cp "$INSTDIR/oridesti.txt" "$CONFDIR"
+ # Copio umbrales y oridesti una sola vez
+ if [ ! -f "$OWNCONFDIR/oridesti.txt" ]; then
+ cp "$INSTDIR/oridesti.txt" "$OWNCONFDIR"
+ fi
+ if [ ! -f "$OWNCONFDIR/umbrales.param" ]; then
+ cp "$INSTDIR/umbrales.param" "$OWNCONFDIR"
+ fi
+ if [ ! -f "$OWNCONFDIR/umbrales.id" ]; then
+ echo 0 >> "$OWNCONFDIR/umbrales.id"
+ fi
# Guardo los datos en el archivo de configuracion
+ ownconffile="$OWNCONFDIR/conf/${comando%.pl}.conf"
+ if [ -f "$ownconffile" ]; then
+ rm -rf "$ownconffile"
+ fi
userid=$LOGNAME
fecha=$(date +%d/%m/%Y)
case $comando in
havefraude=1;
userfraude=$userid;
fechafraude=$fecha;;
- esac
+ esac
changeLine "$CONFFILE" "$numline" "Comando $comando"
numline=$(($numline+1))
changeLine "$CONFFILE" "$numline" "BINDIR = $BINDIR"
+ echo "BINDIR=\"$BINDIR\"" >> $ownconffile
numline=$(($numline+1))
changeLine "$CONFFILE" "$numline" "LOGDIR = $LOGDIR"
+ echo "LOGDIR=\"$LOGDIR\"" >> $ownconffile
numline=$(($numline+1))
changeLine "$CONFFILE" "$numline" "LOGFILE = $LOGFILE"
+ echo "LOGFILE=\"$LOGFILE\"" >> $ownconffile
numline=$(($numline+1))
changeLine "$CONFFILE" "$numline" "LOGSIZE = $LOGSIZE"
+ echo "LOGSIZE=$LOGSIZE" >> $ownconffile
numline=$(($numline+1))
if [ "$comando" = "antifraude.pl" ]; then
changeLine "$CONFFILE" "$numline" "DATADIR = $DATADIR"
+ echo "DATADIR=\"$DATADIR\"" >> $ownconffile
numline=$(($numline+1))
changeLine "$CONFFILE" "$numline" "DATASIZE = "
numline=$(($numline+1))
read
done
-# Creacion de archivos auxiliares
-echo "0" > "$CONFDIR/umbrales.id"
-
# [STEP6] Ofrecer arrancar el Afimonio si estan los tres paquetes instalados
# [STEP7] Mostrar en un recuadro que se encuentra instalado en el sistema