/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to debian/mandos-client.postrm

merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
 
1
#!/bin/sh -e
2
2
# This script can be called in the following ways:
3
3
#
4
4
# After the package was removed:
26
26
# If preinst fails during upgrade:
27
27
#       <new-postrm> abort-upgrade <old-version>
28
28
 
29
 
set -e
30
29
 
31
 
# Update the initial RAM file system image
 
30
# Update the initramfs
32
31
update_initramfs()
33
32
{
34
 
    if command -v update-initramfs >/dev/null; then
35
 
        update-initramfs -k all -u
36
 
    elif command -v dracut >/dev/null; then
37
 
        # Logic taken from dracut.postinst
38
 
        for kernel in /boot/vmlinu[xz]-*; do
39
 
            kversion="${kernel#/boot/vmlinu[xz]-}"
40
 
            if [ "$kversion" != "*" ]; then
41
 
                /etc/kernel/postinst.d/dracut "$kversion"
42
 
            fi
43
 
        done
44
 
    fi
 
33
        if type update-initramfs >/dev/null 2>&1 ; then
 
34
                update-initramfs -u -k all
 
35
        fi
45
36
}
46
37
 
 
38
 
47
39
case "$1" in
48
40
    remove)
49
41
        update_initramfs
50
42
        ;;
51
43
 
52
44
    purge)
53
 
        shred --remove /etc/keys/mandos/seckey.txt 2>/dev/null || :
 
45
        shred --remove /etc/keys/mandos/seckey.txt || :
54
46
        rm --force /etc/mandos/plugin-runner.conf \
55
47
            /etc/keys/mandos/pubkey.txt \
56
 
            /etc/keys/mandos/seckey.txt \
57
 
            /etc/keys/mandos/tls-privkey.pem \
58
 
            /etc/keys/mandos/tls-pubkey.pem \
59
 
            /etc/keys/mandos/dhparams.pem 2>/dev/null
60
 
        update_initramfs
 
48
            /etc/keys/mandos/seckey.txt
 
49
        rmdir /etc/keys/mandos /etc/mandos/plugins.d /etc/mandos || :
61
50
        ;;
62
51
    upgrade|failed-upgrade|disappear|abort-install|abort-upgrade)
63
52
        ;;
64
53
 
65
54
    *)
66
 
        echo "$0 called with unknown argument '$1'" 1>&2
 
55
        echo "$0 called with unknown argument \`$1'" 1>&2
67
56
        exit 1
68
57
        ;;
69
58
esac