X-Git-Url: https://git.llucax.com/z.facultad/75.08/llamadas.git/blobdiff_plain/358fbecf905065cc10ef70b975349fb835161190..c73e52eb8d8b3798ac447fc5a851140a7472ed6c:/afinstal?ds=sidebyside diff --git a/afinstal b/afinstal index 52cf213..6b86e32 100755 --- a/afinstal +++ b/afinstal @@ -163,6 +163,7 @@ CONFDIR="${CURRDIR}/conf" INSTDIR="${CURRDIR}/inst" CONFFILE="${CONFDIR}/afinstal.conf" DEFAULTDIR=$CURRDIR +OWNCONFDIR="$HOME/.antifraude/conf" havemonio=0 haveconf=0 havefraude=0 @@ -261,6 +262,15 @@ if [ ! -f "$CONFFILE" ] || [ ! -s "$CONFFILE" ]; then echo "" >> $CONFFILE done fi +if [ ! -f "$HOME/.antifraude" ]; then + mkdir -p "$HOME/.antifraude" +fi +if [ ! -f "$HOME/.antifraude/lock" ]; then + mkdir -p "$HOME/.antifraude/lock" +fi +if [ ! -f "$HOME/.antifraude/conf" ]; then + mkdir -p "$HOME/.antifraude/conf" +fi # Comienzo la instalacion de cada componente comandos=`echo $toinstall | sed s%,%" "%g` @@ -372,7 +382,7 @@ MARCA mkdir -p "$DATADIR"/{aprocesar,enproceso,rechazadas,procesadas} mkdir -p "$DATADIR/alarmas" fi - echo ">> Copiando Archivos....." + echo ">> Moviendo Archivos....." cp "$INSTDIR/$comando" "$BINDIR" chmod u+x "$BINDIR/$comando" @@ -380,6 +390,10 @@ MARCA cp "$INSTDIR/oridesti.txt" "$CONFDIR" # Guardo los datos en el archivo de configuracion + ownconffile="$OWNCONFDIR/${comando%.pl}.conf" + if [ -f "$ownconffile" ]; then + rm -rf "$ownconffile" + fi userid=$LOGNAME fecha=$(date +%d/%m/%Y) case $comando in @@ -395,20 +409,25 @@ MARCA 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)) @@ -416,6 +435,8 @@ MARCA changeLine "$CONFFILE" "$numline" "USERID = $userid" numline=$(($numline+1)) changeLine "$CONFFILE" "$numline" "FECINS = $fecha" + echo ">> InstalaciĆ³n del componente $comando completada" + read done # Creacion de archivos auxiliares