]> git.llucax.com Git - z.facultad/75.08/llamadas.git/commitdiff
Se agrega prefijo a las vars de los .conf y se valida que el rootpath especificado...
authorAlan Kennedy <kennedya@3dgames.com.ar>
Sun, 24 Oct 2004 18:07:26 +0000 (18:07 +0000)
committerAlan Kennedy <kennedya@3dgames.com.ar>
Sun, 24 Oct 2004 18:07:26 +0000 (18:07 +0000)
afinstal

index eea08760a12d64483583e5c1c084e9b8125049aa..4792d781f3cbd2c2e28e3b4bef2a168dda3e8808 100755 (executable)
--- a/afinstal
+++ b/afinstal
@@ -303,10 +303,19 @@ do
 MARCA
 
        # Le pido un rootpath donde se instalara este comando en particular
-       leer ">> Ingrese la ruta de instalaciĆ³n" "$CURRDIR/grupoNN" userpath
-       if [ -n "$userpath" ]; then     ROOTPATH=$userpath
-       else ROOTPATH="$CURRDIR/grupoNN"
-       fi
+       is_writeable=0
+       while [ $is_writeable -eq 0 ]; do
+               leer ">> Ingrese la ruta de instalaciĆ³n" "$CURRDIR/grupoNN" userpath
+               if [ -n "$userpath" ]; then
+                       ROOTPATH=$userpath
+                       if [ -w "${userpath%/*}" ]; then is_writeable=1
+                       else echo ">> ERROR: No es posible crear dicho directorio"
+                       fi
+               else 
+                       ROOTPATH="$CURRDIR/grupoNN"
+                       is_writible=1
+               fi
+       done
 
        # preparlos los dirs que voy a sugerir
        BINDIR="${ROOTPATH}/bin"
@@ -407,34 +416,37 @@ MARCA
                "afimonio" ) numline=30;
                        havemonio=1;
                        usermonio=$userid;
-                       fechamonio=$fecha;;
+                       fechamonio=$fecha;
+                       prefix="AFIM";;
                "aficonf" ) numline=20;
                        haveconf=1;
                        userconf=$userid;
-                       fechaconf=$fecha;;
+                       fechaconf=$fecha;
+                       prefix="AFIC";;
                "antifraude.pl" ) numline=10;
                        havefraude=1;
                        userfraude=$userid;
-                       fechafraude=$fecha;;
+                       fechafraude=$fecha;
+                       prefix="ANTI";;
        esac
                
        changeLine "$CONFFILE" "$numline" "Comando $comando"
        numline=$(($numline+1))
        changeLine "$CONFFILE" "$numline" "BINDIR = $BINDIR"
-       echo "BINDIR=\"$BINDIR\"" >> $ownconffile
+       echo "${prefix}_BINDIR=\"$BINDIR\"" >> $ownconffile
        numline=$(($numline+1))
        changeLine "$CONFFILE" "$numline" "LOGDIR = $LOGDIR"
-       echo "LOGDIR=\"$LOGDIR\"" >> $ownconffile
+       echo "${prefix}_LOGDIR=\"$LOGDIR\"" >> $ownconffile
        numline=$(($numline+1))
        changeLine "$CONFFILE" "$numline" "LOGFILE = $LOGFILE"
-       echo "LOGFILE=\"$LOGFILE\"" >> $ownconffile
+       echo "${prefix}_LOGFILE=\"$LOGFILE\"" >> $ownconffile
        numline=$(($numline+1))
        changeLine "$CONFFILE" "$numline" "LOGSIZE = $LOGSIZE"
-       echo "LOGSIZE=$LOGSIZE" >> $ownconffile
+       echo "${prefix}_LOGSIZE=$LOGSIZE" >> $ownconffile
        numline=$(($numline+1))
        if [ "$comando" = "antifraude.pl" ]; then
                changeLine "$CONFFILE" "$numline" "DATADIR = $DATADIR"
-               echo "DATADIR=\"$DATADIR\"" >> $ownconffile
+               echo "${prefix}_DATADIR=\"$DATADIR\"" >> $ownconffile
                numline=$(($numline+1))
                changeLine "$CONFFILE" "$numline" "DATASIZE = "
                numline=$(($numline+1))