File: common

package info (click to toggle)
monkeysphere 0.44-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 684 kB
  • sloc: sh: 1,451; perl: 759; ansic: 719; makefile: 91
file content (38 lines) | stat: -rw-r--r-- 772 bytes parent folder | download | duplicates (3)
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
29
30
31
32
33
34
35
36
37
38
# -*-shell-script-*-

failed_cleanup() {
    # FIXME: can we be more verbose here?
    echo 'FAILED!'
    if [ -z "$MONKEYSPHERE_TEST_NO_EXAMINE" ] ; then
	printf "press enter to cleanup and remove tmp (or type 'bash' for a subshell to examine): " >&2
	read XX
	if [ "$XX" = bash ] ; then
	    echo "Entering subshell..."
	    cd "$TEMPDIR"
	    bash
	fi
    fi

    cleanup
}

get_gpg_prng_arg() {
    if (gpg --quick-random --version >/dev/null 2>&1) ; then
	echo quick-random
    elif (gpg --debug-quick-random --version >/dev/null 2>&1) ; then
	echo debug-quick-random
    fi
}

cleanup() {
    echo "### removing temp dir..."
    rm -rf "$TEMPDIR"

    if [ "$SSHD_PID" ] ; then
	echo "### killing off lingering sshd..."
	kill "$SSHD_PID"
    fi

    jobs
    wait
}