From fdb4c344e4ecfbac36bf145814c5cb9708dd5946 Mon Sep 17 00:00:00 2001 From: Alan Kennedy Date: Sun, 24 Oct 2004 18:07:26 +0000 Subject: [PATCH] Se agrega prefijo a las vars de los .conf y se valida que el rootpath especificado para la instalacion de un componente se pueda crear --- afinstal | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/afinstal b/afinstal index eea0876..4792d78 100755 --- 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)) -- 2.43.0