added the makecd ninjahelper, and updated the Authors
[matthijs/upstream/backupninja.git] / handlers / makecd.helper
1 HELPERS="$HELPERS makecd:makecd_backup"
2 wizardname="makecd action wizard"
3
4 declare -a makecd_excludes
5
6 makecd_wizard() {
7
8   inputBox "$wizardname" "specify a burner type cd or dvd:"
9   [ $? = 1 ] && return
10   burnertype="burnertype = $REPLY"
11
12   #checkBox "makecd action wizard" "check options" \
13   #  "isoonly" "only create iso image do not burn" yes
14   #status=$?
15   #[ $status = 1 ] && return;    
16   #isoonly="isoonly = $REPLY"
17
18   booleanBox "$wizardname" "Make iso image only? or burn"
19   if [ $? = 0 ]; then
20      isoonly="isoonly = yes"
21   else
22      isoonly="isoonly = no"
23   fi
24
25   # backupdir
26   inputBox "$wizardname" "Directory where to store the backups:"
27   [ $? = 1 ] && return
28   backupdir="backupdir = $REPLY"
29
30   inputBox "$wizardname" "what name to give to the image file?"
31   [ $? = 1 ] && return
32   imagefile="imagefile = $REPLY"
33
34   inputBox "$wizardname" "specify a burner device:"
35   [ $? = 1 ] && return
36   device="device = $REPLY"
37
38   # target - root of system to be included
39   inputBox "$wizardname" "root of filesystem for burn:"
40   [ $? = 1 ] && return
41   target="target = $REPLY"
42
43
44    # excludes
45
46   formBegin "$wizardname: excludes" 
47     for ((i=0; i < ${#makecd_excludes[@]} ; i++)); do
48        formItem exclude ${makecd_excludes[$i]}
49     done
50     formItem exclude 
51     formItem exclude 
52     formItem exclude 
53     formItem exclude 
54     formItem exclude 
55     formItem exclude 
56     formItem exclude 
57     formItem exclude 
58     formItem exclude 
59   formDisplay
60   [ $? = 1 ] && return;
61
62   unset makecd_excludes
63   makecd_excludes=($REPLY)
64
65   get_next_filename $configdirectory/20.makecd
66   cat >> $next_filename <<EOF
67
68 # TYP is cd or dvd AS WELL AS the disk inside!!
69 $burnertype
70
71 # not yet supported
72 system = no
73
74 # iso or burn to cd/dvd?
75 $isoonly
76
77 # location for image file
78 $backupdir
79
80 # image filename
81 $imagefile
82
83 # cd/dvd burner device
84 $device
85
86 # dirs/files to include in the backup
87 $target
88
89 # directories/files to be excluded
90 # exclude = /proc
91 # exclude = /sys
92 # exclude = /dev
93 EOF
94
95   for ((j=0; j < ${#makecd_excludes[@]} ; j++)); do
96     echo "exclude = ${makecd_excludes[$j]}" >> $next_filename
97   done
98    
99    chmod 600 $next_filename
100 }
101