/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh -e

# If not on a tty, then get rid of possibly disrupting stderr output
if ! tty -s; then
    exec 2>/dev/null
fi

test -x /sbin/splashy_update

# We get some variables from cryptsetup:
# $cryptsource	the device node, like "/dev/sda3"
# $crypttarget	the device mapper name, like "sda3_crypt".

prompt="Enter passphrase to unlock"
if [ -n "$crypttarget" ]; then
    prompt="$prompt the disk $crypttarget"
fi
if [ -n "$cryptsource" ]; then
    prompt="$prompt ($cryptsource)"
fi

splash_input_password(){
    /sbin/splashy_update "getpass $1"
}

password="`splash_input_password \"$prompt: \"`"

echo -n "$password"