aboutsummaryrefslogtreecommitdiff
path: root/debian/naskpass.postinst
blob: 025c25d5a446f2797b2529d4f6261e1fa593f3f3 (plain)
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
#!/bin/sh
# postinst script for naskpass
#
# see: dh_installdeb(1)

set -e

. /usr/share/debconf/confmodule

case "$1" in

    configure)
	if [ -x /usr/bin/ssh-keygen ]; then
		[ -r /etc/initramfs-tools/etc/ssh/ssh_host_rsa_key ] || /usr/bin/ssh-keygen -t rsa -N '' -b 4096 -f /etc/initramfs-tools/etc/ssh/ssh_host_rsa_key
		[ -r /etc/initramfs-tools/etc/ssh/ssh_host_dsa_key ] || /usr/bin/ssh-keygen -t dsa -N '' -b 1024 -f /etc/initramfs-tools/etc/ssh/ssh_host_dsa_key
		[ -r /etc/initramfs-tools/etc/ssh/authorized_keys ] || cat /etc/initramfs-tools/etc/ssh/ssh_host_rsa_key.pub >/etc/initramfs-tools/etc/ssh/authorized_keys
	fi
        update-initramfs -u
    ;;

    install|upgrade|abort-upgrade)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0