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