Mercurial > dropbear
comparison debian/postinst @ 4:fe6bca95afa7
Makefile.in contains updated files required
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 01 Jun 2004 02:46:09 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 4:fe6bca95afa7 |
---|---|
1 #! /bin/sh | |
2 # postinst script for #PACKAGE# | |
3 # | |
4 # see: dh_installdeb(1) | |
5 | |
6 set -e | |
7 | |
8 # summary of how this script can be called: | |
9 # * <postinst> `configure' <most-recently-configured-version> | |
10 # * <old-postinst> `abort-upgrade' <new version> | |
11 # * <conflictor's-postinst> `abort-remove' `in-favour' <package> | |
12 # <new-version> | |
13 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' | |
14 # <failed-install-package> <version> `removing' | |
15 # <conflicting-package> <version> | |
16 # for details, see http://www.debian.org/doc/debian-policy/ or | |
17 # the debian-policy package | |
18 # | |
19 # quoting from the policy: | |
20 # Any necessary prompting should almost always be confined to the | |
21 # post-installation script, and should be protected with a conditional | |
22 # so that unnecessary prompting doesn't happen if a package's | |
23 # installation fails and the `postinst' is called with `abort-upgrade', | |
24 # `abort-remove' or `abort-deconfigure'. | |
25 | |
26 case "$1" in | |
27 configure) | |
28 if [ ! -e /etc/dropbear/dropbear_rsa_host_key ]; then | |
29 if [ -f /etc/ssh/ssh_host_rsa_key ]; then | |
30 echo "Converting existing OpenSSH RSA host key to Dropbear format." | |
31 /usr/bin/dropbearconvert openssh dropbear /etc/ssh/ssh_host_rsa_key /etc/dropbear/dropbear_rsa_host_key | |
32 else | |
33 echo "Generating Dropbear RSA key. Please wait." | |
34 /usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key | |
35 fi | |
36 fi | |
37 if [ ! -e /etc/dropbear/dropbear_dss_host_key ]; then | |
38 if [ -f /etc/ssh/ssh_host_dsa_key ]; then | |
39 echo "Converting existing OpenSSH RSA host key to Dropbear format." | |
40 /usr/bin/dropbearconvert openssh dropbear /etc/ssh/ssh_host_dsa_key /etc/dropbear/dropbear_dss_host_key | |
41 else | |
42 echo "Generating Dropbear DSS key. Please wait." | |
43 /usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key | |
44 fi | |
45 fi | |
46 if [ ! -s /etc/default/dropbear ]; then | |
47 # check whether OpenSSH seems to be installed. | |
48 if dpkg -l ssh >/dev/null 2>&1; then | |
49 echo "OpenSSH appears to be installed. Setting /etc/default/dropbear" | |
50 echo "so that Dropbear will not start by default. Edit this file to change" | |
51 echo "this behaviour." | |
52 echo "# disabled because OpenSSH is installed, change to NO_START=0 to enable Dropbear" > /etc/default/dropbear | |
53 echo "NO_START=1" >> /etc/default/dropbear | |
54 fi | |
55 echo "# the TCP port that Dropbear listens on" >> /etc/default/dropbear | |
56 echo "DROPBEAR_PORT=22" >> /etc/default/dropbear | |
57 echo "# any additional arguments for Dropbear" >> /etc/default/dropbear | |
58 echo "DROPBEAR_EXTRA_ARGS=" >> /etc/default/dropbear | |
59 echo "# specify an optional banner file containing a message to be" >> /etc/default/dropbear | |
60 echo "# sent to clients before they connect, such as \"/etc/issue.net\"" >> /etc/default/dropbear | |
61 echo "DROPBEAR_BANNER=\"\"" >> /etc/default/dropbear | |
62 echo "# RSA hostkey file (default: /etc/dropbear/dropbear_rsa_host_key" >> /etc/default/dropbear | |
63 echo "#DROPBEAR_RSAKEY=\"/etc/dropbear/dropbear_rsa_host_key\"" >> /etc/default/dropbear | |
64 echo "# DSS hostkey file (default: /etc/dropbear/dropbear_dss_host_key" >> /etc/default/dropbear | |
65 echo "#DROPBEAR_DSSKEY=\"/etc/dropbear/dropbear_dss_host_key\"" >> /etc/default/dropbear | |
66 fi | |
67 if [ -e /etc/init.d/dropbear ]; then | |
68 update-rc.d dropbear defaults >/dev/null | |
69 /etc/init.d/dropbear restart | |
70 fi | |
71 ;; | |
72 | |
73 abort-upgrade|abort-remove|abort-deconfigure) | |
74 | |
75 ;; | |
76 | |
77 *) | |
78 echo "postinst called with unknown argument \`$1'" >&2 | |
79 exit 1 | |
80 ;; | |
81 esac | |
82 | |
83 # dh_installdeb will replace this with shell code automatically | |
84 # generated by other debhelper scripts. | |
85 | |
86 | |
87 | |
88 exit 0 | |
89 | |
90 |