summaryrefslogtreecommitdiffstats
path: root/dropbear.pkg/postinst
blob: d6dd9711bdf1c975995785aa05a92c85fd5790b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

if [ "x${1}" = 'xconfigure' ]; then
	update-alternatives --install /usr/bin/ssh ssh /usr/bin/dropbearmulti 10
	mkdir -p /etc/dropbear
	for keytype in rsa dsa; do
		if ! [ -f "/etc/dropbear/dropbear_${keytype}_host_key" ]; then
			/usr/bin/dropbearkey -t "${keytype}" \
				-f "/etc/dropbear/dropbear_${keytype}_host_key"
		fi
	done
	/etc/init.d/dropbear enable
	/etc/init.d/dropbear start
fi