if [ ! -d /archives/config ]; then
  dialog --title "Repertoire /archives/config inexistant" --msgbox " 
Vous ne pouvez pas charger de \
configurations." 9 60 
  exit
fi


dialog --yesno "   Voulez vous faire un BACKUP TOTAL ? " 6 60 

         if [ $? != 1 ]; then


  dialog --msgbox "	 	ATTENTION la sauvegarde aura le nom BACKUP.TAR \n
	IL NE PEUT Y AVOIR QU'UN SEUL FICHIER BACKUP.TAR PAR DISK ! \n
         Veuillez inserer une disquette au format DOS \n
 			dans le lecteur A " 10 70

                tar -czvf /tmp/`hostname`.TGZ /archives/config
                mcopy /tmp/`hostname`.TGZ a:
		rm /tmp/`hostname`.TGZ
                exit
                fi


cat << EOF > /tmp/choiscript
dialog --title "BACKUP d'une CONFIGURATION" --menu "
Vous devez selectionner une configuration. 
Pour cela utilisez les touches du curseur.
" 20 68 9 \\
EOF
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`"
  rm -f /tmp/choixligne/

  dialog --msgbox "          Veuillez inserer une disquette au format DOS \n
 			dans le lecteur A " 10 70

  tar -czvf /tmp/$NOM.tgz /archives/config/$NOM

  mcopy /tmp/$NOM.tgz a: 

  rm -f /tmp/$NOM.tgz
