summaryrefslogtreecommitdiffstats
path: root/dropbear.pkg/postinst
blob: 90b2891e23fd3d57af5c48d9d464efe62b211b23 (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 ecdsa; 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