sys: only run mdadm if RAID devices actually exist (Closes: #572450)
[matthijs/upstream/backupninja.git] / handlers / sys.helper.in
1 # -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
2 # vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
3
4 HELPERS="$HELPERS sys:general_hardware_and_system_info"
5
6 sys_wizard() {
7    require_packages hwinfo debconf-utils
8    checkBox "new sys action" "check options" \
9       "packages" "list of all installed packages." on \
10       "partitions" "the partition table of all disks." on  \
11       "sfdisk" "use sfdisk to get partition information." on \
12       "hardware" "detailed hardware information" on \
13       "luksheaders" "Luks headers of all Luks partitions." off \
14       "lvm" "LVM metadata for all volume groups." off
15    [ $? = 1 ] && return;
16    result="$REPLY"
17    packages="packages = no"
18    partitions="partitions = no"
19    sfdisk="dosfdisk = no"
20    hardware="hardware = no"
21    luksheaders="luksheaders = no"
22    lvm="lvm = no"
23    for opt in $result; do
24       case $opt in
25          '"packages"') packages="packages = yes";;
26          '"partitions"') partitions="partitions = yes";;
27          '"sfdisk"') sfdisk="dosfdisk = yes";;
28          '"hardware"') hardware="hardware = yes";;
29          '"luksheaders"') luksheaders="luksheaders = yes";;
30          '"lvm"') lvm="lvm = yes";;
31       esac
32    done
33    get_next_filename $configdirectory/10.sys
34    cat > $next_filename <<EOF
35 $packages
36 $partitions
37 $sfdisk
38 $hardware
39 $luksheaders
40 $lvm
41
42 # packagesfile = /var/backups/dpkg-selections.txt
43 # selectionsfile = /var/backups/debconfsel.txt
44 # partitionsfile = /var/backups/partitions.__star__.txt
45 # hardwarefile = /var/backups/hardware.txt
46 # luksheadersfile = /var/backups/luksheader.__star__.bin
47
48 # If vservers = yes in /etc/backupninja.conf then the following variables can
49 # be used:
50 # vsnames = all | <vserver1> <vserver2> ... (default = all)
51 EOF
52    chmod 600 $next_filename
53 }
54