Bingo, ça fonctionne :
La partie :
(pv /dev/sr0 -n -r | dd of=$OF.iso bs=$BS count=$VS) 2>&1 | zenity --progress --title "Clonage Avec DD" --text="Création Du Fichier ISO En Cours ..." --percentage=1 --width=640 --height=100 &
C'est bien une progression et non le pulsate
Le bouton arrêt stoppe bien le programme.
Je range tout ça dans le script et je poste le merdier
EDIT:
#!/bin/bash
#cvlc :start-time=1 --stop-time=4 dvd:///dev/sr0 vlc://quit
BS=$(isoinfo -d -i /dev/sr0 | grep "^Logical block size is:" | awk '{print $5}')
VS=$(isoinfo -d -i /dev/sr0 | grep "^Volume size is:" | awk '{print $4}')
VSID=$(isoinfo -d -i /dev/sr0 | grep "Volume set id: " | awk '{print $4}')
VID=$(isoinfo -d -i /dev/sr0 | grep "^Volume id: " | awk '{print $3}')
if [ -z $1 ]; then
if [ -z $VSID ] || [ "$VSID" == "UNDEFINED" ] || [ "$VSID" == "NOT_SET" ] || [ $VID == $VSID ] ; then
OF=${VID}
else
OF=${VID}_${VSID}
fi
else
OF=$(basename $1 .iso) # just in case I accidentally pasted in a name with .iso
fi
echo $OF
echo $BS
echo $VS
#(pv /dev/sr0 | dd conv=noerror bs=$BS count=$VS of=$OF.iso) | zenity --title="DD" --progress --width=600 --height=50 --pulsate --auto-close &
(pv /dev/sr0 -n -r | dd of=$OF.iso bs=$BS count=$VS) 2>&1 | zenity --progress --title "Clonage Avec DD" --text="Création Du Fichier ISO En Cours ..." --percentage=1 --width=640 --height=100 &
#(pv -n /dev/sr0 | dd conv=noerror bs=$BS count=$VS of=$OF.iso) 2>&1 | dialog --gauge "Copie du DVD, Attendre..." 10 70 0
# Get Zenity Brother Process Which is Parent of All Running Tasks
PID_ZENITY=$(ps -C zenity h -o pid,command | grep "DD" | awk '{print $1}')
PID_PARENT=$(ps -p ${PID_ZENITY} -o ppid=)
PID_CHILDREN=$(pgrep -d ',' -P ${PID_PARENT})
# Loop To Check That Progress Dialog Has Not Been Cancelled
while [ "$PID_ZENITY" != "" ]
do
# Get PID of Running Processes For The Children
PID_GRANDCHILDREN=$(pgrep -d ' ' -P "${PID_CHILDREN}")
# Check if Zenity PID is Still There (Dialog Box Still Open)
PID_ZENITY=$(ps h -o pid -p ${PID_ZENITY})
# Sleep for 2 Second
sleep 2
done
# if Some Running Tasks are Still There, Kill Them
[ "${PID_GRANDCHILDREN}" != "" ] && kill -9 ${PID_GRANDCHILDREN}
else
echo "Aucun Choix, Ou Quelque Chose S'est Mal Passé -- Arrêt"
exit 1
fi
Dernière modification par Anonyme (01-04-2017 19:45:40)