- # Si habia algo instalado, la informacion del los directorios quedo
- # almacenada, pues es igual para todos los scripts. Excepto el directorio de
- # datos para antifraude.
- if [ ! -f "$bindir""antifraude.pl" ]; then
- #instalo antifraude porque no existe
- echo "Instalando Antifraude..."
- anti=1
- cp "$instdir/antifraude.pl" "$bindir/antifraude.pl"
- fi
- if [ ! -f "$bindir""aficonf" ]; then
- #instalo aficonf porque no existe
- echo "Instalando Aficonf..."
- afic=1
- cp "$instdir/aficonf" "$bindir/aficonf"
- fi
- if [ ! -f "$bindir""afimonio" ]; then
- #instalo afimonio porque no existe
- echo "Instalando Afimonio..."
- afim=1
- cp "$instdir/afimonio" "$bindir/afimonio"
- fi
-
- #hay que loguear lo que se instalo
- comp=$(($anti + $afic + $afim))
- if [ $anti != 0 ]; then
- echo "Ingrese la ruta completa para el directorio de datos"
- read datadir
- while [ ! -d "$datadir" ]; do
- echo "La ruta especificada no existe, ingrese un directorio existente"
- read datadir
- done
- echo "Ingrese tamaño máximo de datos"
- read datasize
- fecha=$(date)
- cat "$confdir/afinstal.conf" | sed "10s/.*/Comando antifraude.pl/" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "11s(.*(BINDIR = $bindir(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "12s(.*(LOGDIR = $logdir(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "13s(.*(LOGNAME = $logname(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "14s(.*(LOGSIZE = $logsize(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "15s(.*(DATADIR = $datadir(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "16s(.*(DATASIZE = $datasize(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "17s(.*(USERID = $USER(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "18s(.*(FECINS = $fecha(" > "$confdir/afinstal.conf"
- fi
- if [ $afic != 0 ]; then
- fecha=$(date)
- cat "$confdir/afinstal.conf" | sed "20s/.*/Comando aficonf/" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "21s(.*(BINDIR = $bindir(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "22s(.*(LOGDIR = $logdir(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "23s(.*(LOGNAME = $logname(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "24s(.*(LOGSIZE = $logsize(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "25s(.*(USERID = $USER(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "26s(.*(FECINS = $fecha(" > "$confdir/afinstal.conf"
- fi
- if [ $afim != 0 ]; then
- fecha=$(date)
- cat "$confdir/afinstal.conf" | sed "30s/.*/Comando afimonio/" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "31s(.*(BINDIR = $bindir(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "32s(.*(LOGDIR = $logdir(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "33s(.*(LOGNAME = $logname(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "34s(.*(LOGSIZE = $logsize(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "35s(.*(USERID = $USER(" > "$confdir/afinstal.conf"
- cat "$confdir/afinstal.conf" | sed "36s(.*(FECINS = $fecha(" > "$confdir/afinstal.conf"
- fi
- if [ $comp == 0 ]; then
-
- #busco los datos
- fecha1=`cat $afinstal | grep -n FECINS | grep 18 | sed s/\.\*\=\ //`
- fecha2=`cat $afinstal | grep -n FECINS | grep 26 | sed s/\.\*\=\ //`
- fecha3=`cat $afinstal | grep -n FECINS | grep 36 | sed s/\.\*\=\ //`
- usu1=`cat $afinstal | grep -n USERID | grep 17 | sed s/\.\*\=\ //`
- usu2=`cat $afinstal | grep -n USERID | grep 25 | sed s/\.\*\=\ //`
- usu3=`cat $afinstal | grep -n USERID | grep 35 | sed s/\.\*\=\ //`
-
-cat<<MARCA
-***************************************************************
-* Se encuentran instalados los siguientes componentes: *
-* Antifraude.pl instalado el $fecha1 por $usu1 *
-* Aficonf instalado el $fecha2 por $usu2 *
-* Antifraude.pl instalado el $fecha3 por $usu3 *
-* *
-* Copyright TPSistemasOp (c) 2004 *
-***************************************************************
-
-Proceso de instalación cancelado.
-MARCA
- exit 0
- fi
-fi