aboutsummaryrefslogtreecommitdiff
path: root/handlers/makecd.helper.in
blob: ad0c4aa3a92b0ce72e52bf5521f4de658aec5904 (plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:

HELPERS="$HELPERS makecd:makecd_backup"
wizardname="makecd action wizard"

declare -a makecd_excludes

makecd_wizard() {

   inputBox "$wizardname" "specify a burner type cd or dvd:"
   [ $? = 1 ] && return
   burnertype="burnertype = $REPLY"

   booleanBox "$wizardname" "Make iso image only? or burn"
   if [ $? = 0 ]; then
      isoonly="isoonly = yes"
   else
      isoonly="isoonly = no"
   fi

   # backupdir
   inputBox "$wizardname" "Directory where to store the backups:"
   [ $? = 1 ] && return
   backupdir="backupdir = $REPLY"

   inputBox "$wizardname" "what name to give to the image file?"
   [ $? = 1 ] && return
   imagefile="imagefile = $REPLY"

   inputBox "$wizardname" "specify a burner device:"
   [ $? = 1 ] && return
   device="device = $REPLY"

   # target - root of system to be included
   inputBox "$wizardname" "root of filesystem for burn:"
   [ $? = 1 ] && return
   target="target = $REPLY"


    # excludes

   formBegin "$wizardname: excludes"
      for ((i=0; i < ${#makecd_excludes[@]} ; i++)); do
         formItem exclude ${makecd_excludes[$i]}
      done
      formItem exclude
      formItem exclude
      formItem exclude
      formItem exclude
      formItem exclude
      formItem exclude
      formItem exclude
      formItem exclude
      formItem exclude
   formDisplay
   [ $? = 1 ] && return;

   unset makecd_excludes
   makecd_excludes=($REPLY)

   get_next_filename $configdirectory/20.makecd
   cat >> $next_filename <<EOF

# TYP is cd or dvd AS WELL AS the disk inside!!
$burnertype

# not yet supported
system = no

# iso or burn to cd/dvd?
$isoonly

# location for image file
$backupdir

# image filename
$imagefile

# cd/dvd burner device
$device

# dirs/files to include in the backup
$target

# directories/files to be excluded
# exclude = /proc
# exclude = /sys
# exclude = /dev
EOF

   for ((j=0; j < ${#makecd_excludes[@]} ; j++)); do
      echo "exclude = ${makecd_excludes[$j]}" >> $next_filename
   done

   chmod 600 $next_filename
}