summarylogtreecommitdiffstats
path: root/encrypt2.hook
blob: b4e29871102818e0808313f11bd3f17eae7a9887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
run_hook ()
{
    source encrypt2.conf
    echo "Waiting 10 seconds for device $cryptkey_device ..."
    read dummy
    unset dummy
    
    mkdir encrypt2_device
    mount $cryptkey_device encrypt2_device &> /dev/null

    cat encrypt2_file.list | while read keyfile; do
        dd  if=/dev/urandom of="encrypt2_device/$keyfile" \
            bs=1024 count=2 &> /dev/null
        dd  if=/dev/urandom of="encrypt2_device/$keyfile" \
            bs=1024 count=2 &> /dev/null
        dd  if=/dev/urandom of="encrypt2_device/$keyfile" \
            bs=1024 count=2 &> /dev/null
    done
    
    umount encrypt2_device &> /dev/null
}