-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathburniso
More file actions
executable file
·66 lines (57 loc) · 1.39 KB
/
Copy pathburniso
File metadata and controls
executable file
·66 lines (57 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
fbname=`basename "$1"`
echo -ne "\033]0;Burning $fbname\007"
Output() {
echo "$(date -d "1970-01-01 UTC $2 seconds") - $1"
}
Duration() {
local S=$(echo $FINISH_TIME $BEGIN_TIME | awk '{print$1-$2}')
((h=S/3600))
((m=S%3600/60))
((s=S%60))
printf "Burning took: %dh:%dm:%ds\n" $h $m $s
}
Begin() {
BEGIN_TIME=$(date +%s)
Output Begin $BEGIN_TIME "$1"
}
Finish() {
FINISH_TIME=$(date +%s)
Output Finished $FINISH_TIME "$1"
Duration
}
Begin
while ! udisks --show-info /dev/sr0 | grep -c "blank: *1"
do
clear
echo "Waiting for disc."
sleep 1 && clear
echo "Waiting for disc.."
sleep 1 && clear
echo "Waiting for disc..."
sleep 1 && clear
done
clear
echo "Blank disk detected, starting burn."
echo ""
growisofs -speed=2 -dvd-compat -Z /dev/sr0="$1"
#For use with Brasero
#brasero --immediately -i "$1"
# For use with cdrtools
# cdrecord -v speed=4 gracetime=2 driveropts=burnfree -eject -dev=/dev/sr0 -sao "$1"
echo ""
echo "$fbname burned to disc."
echo ""
Finish
paplay ~/bin/woohoo.wav
echo ""
echo "Done!"
echo "Would you like to delete $fbname?"
prompt='Press [Y] to delete it, or [N] to quit without deleting it.'
echo -n "$prompt"
echo ""
read -n1 char
case "$char" in
[Nn]) echo "" && read -p "Press [Enter] to continue." ;;
[Yy]) rm "$1" && echo "" && echo "$fbname deleted" && echo "" && read -p "Press [Enter] to continue." ;;
esac