#!/bin/bash touch /tmp/dialogtmp && FICHTMP=/tmp/dialogtmp trap "rm -f $FICHTMP" 0 1 2 3 5 15 function build_iso() { until [ "${PLOP}" != "0" ] do msgdir done } function msgdir () { DIALOG=${DIALOG=dialog} $DIALOG --backtitle "Kickstart Generator" --clear \ --inputbox " Entrer le chemin vers le repertoire contenant les donnees du DVD :" 16 60 2> ${FICHTMP} RETVAL=$? DATA_DIR=`cat ${FICHTMP}` if [ -d ${DATA_DIR} ] ; then cd ${DATA_DIR} PLOP=1 else PLOP=0 fi return ${PLOP} } # Fonction du menu function menu () { DIALOG=${DIALOG=dialog} ${DIALOG} --clear --backtitle "Kickstart Generator" \ --ok-label "Valider" --cancel-label "Quitter" --menu "Faite un choix :" 20 51 4 \ "Kickstart" "Creation d'un fichier kickstart" \ "Iso" "Creation d'un image iso" \ "Deux" "Les deux actions" 2> ${FICHTMP} if [ $? = 0 ] then CHOIX=`cat ${FICHTMP}` case ${CHOIX} in Kickstart) build_ks ;; Iso) build_iso ;; Deux) build_2 ;; esac else exit 0 fi } while : do menu done