48841e85ab3e38df5a016013ef10d9fb92fdb085
[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    [ $? = 1 ] && return;    
14    result="$REPLY"
15    packages="packages = no"
16    partitions="partitions = no"
17    sfdisk="dosfdisk = no"
18    hardware="hardware = no"
19    luksheaders="luksheaders = no"
20    for opt in $result; do
21       case $opt in
22         '"packages"') packages="packages = yes";;
23         '"partitions"') partitions="partitions = yes";;
24         '"sfdisk"') sfdisk="dosfdisk = yes";;
25         '"hardware"') hardware="hardware = yes";;
26         '"luksheaders"') luksheaders="luksheaders = yes";;
27       esac
28    done
29    get_next_filename $configdirectory/10.sys
30    cat > $next_filename <<EOF
31 $packages
32 $partitions
33 $sfdisk
34 $hardware
35 $luksheaders
36
37 # packagesfile = /var/backups/dpkg-selections.txt
38 # selectionsfile = /var/backups/debconfsel.txt
39 # partitionsfile = /var/backups/partitions.__star__.txt
40 # hardwarefile = /var/backups/hardware.txt
41 # luksheadersfile = /var/backups/luksheader.__star__.bin
42
43 # If vservers = yes in /etc/backupninja.conf then the following variables can
44 # be used:
45 # vsnames = all | <vserver1> <vserver2> ... (default = all)
46 EOF
47    chmod 600 $next_filename
48 }
49