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