93ae33281d0b5063ea286bf55fe7b05f04f687da
[matthijs/upstream/backupninja.git] / handlers / sys.helper
1 HELPERS="$HELPERS sys:general_hardware_and_system_info"
2
3 sys_wizard() {
4    require_packages hwinfo
5    checkBox "new sys action" "check options" \
6        "packages" "list of all installed packages." on \
7        "partitions" "the partition table of all disks." on  \
8        "hardware" "detailed hardware information" on
9    [ $? = 1 ] && return;    
10    result="$REPLY"
11    packages="packages = off"
12    partitions="partitions = off"
13    hardware="hardware = off"
14    for opt in $result; do
15       case $opt in
16         '"packages"') packages="packages = on";;
17         '"partitions"') partitions="partitions = on";;
18         '"hardware"') hardware="hardware = on";;
19       esac
20    done
21    get_next_filename $configdirectory/10.sys
22    cat > $next_filename <<EOF
23 $packages
24 $partitions
25 $hardware
26 # packagesfile = /var/backups/dpkg-selections.txt
27 # partitionsfile = /var/backups/partitions.__star__.txt
28 # hardwarefile = /var/backups/hardware.txt
29 EOF
30    chmod 000 $next_filename
31 }
32