X-Git-Url: https://git.llucax.com/z.facultad/75.08/llamadas.git/blobdiff_plain/b97ed10380459f2042ba3867c76aab8eb017ee73..4ec598fd3733617e0d4b97f871fc915454d9fc35:/afinstal?ds=sidebyside diff --git a/afinstal b/afinstal index f803f7d..eea0876 100755 --- a/afinstal +++ b/afinstal @@ -163,6 +163,7 @@ CONFDIR="${CURRDIR}/conf" INSTDIR="${CURRDIR}/inst" CONFFILE="${CONFDIR}/afinstal.conf" DEFAULTDIR=$CURRDIR +OWNCONFDIR="$HOME/.antifraude" havemonio=0 haveconf=0 havefraude=0 @@ -261,6 +262,15 @@ if [ ! -f "$CONFFILE" ] || [ ! -s "$CONFFILE" ]; then 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` @@ -364,7 +374,6 @@ MARCA echo ">> Creando Estructura de Directorio...." mkdir -p "$BINDIR" mkdir -p "$LOGDIR" - mkdir -p "$CONFDIR/lock" touch "$LOGDIR/$LOGFILE" if [ "$comando" = "antifraude.pl" ]; then @@ -376,10 +385,22 @@ MARCA 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 @@ -395,20 +416,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)) @@ -420,9 +446,6 @@ MARCA 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