comparison debian/dropbear.postinst @ 70:b0316ce64e4b

Merging in the changes from 0.41-0.43 main Dropbear tree
author Matt Johnston <matt@ucc.asn.au>
date Thu, 12 Aug 2004 16:41:58 +0000
parents
children 743fce568f49 3ee0c2f85e1e
comparison
equal deleted inserted replaced
69:59d16db56e9f 70:b0316ce64e4b
1 #!/bin/sh
2 set -e
3
4 test "$1" = 'configure' || exit 0
5 test -n "$2" || chown log /etc/dropbear/log/main || true
6
7 if test ! -e /etc/dropbear/dropbear_rsa_host_key; then
8 if test -f /etc/ssh/ssh_host_rsa_key; then
9 echo "Converting existing OpenSSH RSA host key to Dropbear format."
10 /usr/lib/dropbear/dropbearconvert openssh dropbear \
11 /etc/ssh/ssh_host_rsa_key /etc/dropbear/dropbear_rsa_host_key
12 else
13 echo "Generating Dropbear RSA key. Please wait."
14 dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
15 fi
16 fi
17 if test ! -e /etc/dropbear/dropbear_dss_host_key; then
18 if test -f /etc/ssh/ssh_host_dsa_key; then
19 echo "Converting existing OpenSSH RSA host key to Dropbear format."
20 /usr/lib/dropbear/dropbearconvert openssh dropbear \
21 /etc/ssh/ssh_host_dsa_key /etc/dropbear/dropbear_dss_host_key
22 else
23 echo "Generating Dropbear DSS key. Please wait."
24 dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
25 fi
26 fi
27 if test ! -s /etc/default/dropbear; then
28 # check whether OpenSSH seems to be installed.
29 if test -x /usr/sbin/sshd; then
30 cat <<EOT
31 OpenSSH appears to be installed. Setting /etc/default/dropbear so that
32 Dropbear will not start by default. Edit this file to change this behaviour.
33
34 EOT
35 cat >>/etc/default/dropbear <<EOT
36 # disabled because OpenSSH is installed
37 # change to NO_START=0 to enable Dropbear
38 NO_START=1
39
40 EOT
41 fi
42 cat >>/etc/default/dropbear <<EOT
43 # the TCP port that Dropbear listens on
44 DROPBEAR_PORT=22
45
46 # any additional arguments for Dropbear
47 DROPBEAR_EXTRA_ARGS=
48
49 # specify an optional banner file containing a message to be
50 # sent to clients before they connect, such as "/etc/issue.net"
51 DROPBEAR_BANNER=""
52
53 # RSA hostkey file (default: /etc/dropbear/dropbear_rsa_host_key)
54 #DROPBEAR_RSAKEY="/etc/dropbear/dropbear_rsa_host_key"
55
56 # DSS hostkey file (default: /etc/dropbear/dropbear_dss_host_key)
57 #DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key"
58 EOT
59 fi
60
61 if test -x /etc/init.d/dropbear; then
62 update-rc.d dropbear defaults >/dev/null
63 if test -x /usr/sbin/invoke-rc.d; then
64 invoke-rc.d dropbear start
65 else
66 /etc/init.d/dropbear start
67 fi
68 fi