Subversion Repositories mysets

Rev

Rev 966 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
281 zsolt 1
#!/bin/sh
2
 
3
BURNDIR=/home/zsolt/.cache/burn/
4
BURNDEVICE=/dev/cd0
5
MKISOFSOPTS="-r -f -v -joliet-long"
966 zsolt 6
GROWISOFSOPTS="-dvd-compat -speed=4 -Z ${BURNDEVICE}"
281 zsolt 7
 
8
error() {
9
  echo -e "\e[31mERR: $*" >&2
10
  exit 1
11
}
12
 
13
msg() {
14
  echo -e "\e[32m>> $*\e[39m"
15
}
16
 
17
if [ ! -d $BURNDIR ]; then
18
  error $BURNDIR does not exist
19
fi
20
 
21
if [ $# -eq 0 ]; then
22
  error Does not set label
23
fi
24
 
25
msg Getting size of $BURNDIR...
26
SIZE=$(du -msL ${BURNDIR} | awk {'print $1'})
27
if [ $SIZE -lt 1000 ]; then
28
  msg "$BURNDIR has too low size (${SIZE}M)"
29
  msg "If correct please ENTER, otherwise please Control-C"
30
  read x
31
elif [ $SIZE -gt 4500 ]; then
32
  error "$BURNDIR has too big size (${SIZE}M)"
33
fi
34
msg "Correct size (${SIZE}M)"
35
 
36
msg "Goto into ${BURNDIR}"
37
cd ${BURNDIR}
38
msg "Files in ${BURNDIR}"
39
echo -e "\e[33m"
40
find -Ls . -type f | sed "s,^\./,," | column -x | sed "s,^,  ,"
41
echo
42
msg "If correct please ENTER, otherwise please Control-C"
43
read x
44
 
45
CMD="growisofs ${GROWISOFSOPTS} -V $1 ${MKISOFSOPTS} ."
46
msg "Run burning with command:"
47
msg ${CMD}
48
${CMD}
49
if [ $? -eq 0 ]; then
50
  msg "Done"
51
else
52
  error "Something wrong. Please check above."
53
fi
54