if [ ! -d /archives/config ]; then
  dialog --title "Repertoire /archives/config inexistant" --msgbox " 
Vous ne pouvez pas charger de \
configurations." 9 60 
  exit
fi
cat << EOF > /tmp/choiscript
dialog --title "VISUALISER une INFORMATION" --menu "
Vous devez selectionner une configuration. 
Pour cela utilisez les touches du curseur.
" 20 68 9 \\
EOF

VAR1=`ls /archives/config/ | wc -l | tail -c2`

if [ $VAR1 = '0' ]; then
exit
fi

for VAR in /archives/config/* ; do
  VAR2=`basename $VAR `
  echo "\"$VAR2\" \"\" \\" >> /tmp/choiscript
done
echo "2> /tmp/choixligne" >> /tmp/choiscript

  . /tmp/choiscript
  if [ ! $? = 0 ]; then rm -f /tmp/choixligne /tmp/choiscript; exit 1; fi
  NOM="`cat /tmp/choixligne`"
  
ls /archives/config/$NOM/info >/dev/null 2>/dev/null

if [ $? = 1 ]; then
  dialog --title "FICHIER info inexistant" --msgbox " 
        Vous ne pouvez pas charger d'information \n
               pour cette configuration." 9 60 
  exit
fi

dialog --title "AFFICHER les CONFIGURATIONS" --textbox /archives/config/$NOM/info 20 70
rm -f /tmp/choixligne
