summaryrefslogtreecommitdiff
path: root/contrib/solaris/postinstall.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/solaris/postinstall.in')
-rw-r--r--contrib/solaris/postinstall.in40
1 files changed, 40 insertions, 0 deletions
diff --git a/contrib/solaris/postinstall.in b/contrib/solaris/postinstall.in
index 6f2c9b303..3ce3bf13d 100644
--- a/contrib/solaris/postinstall.in
+++ b/contrib/solaris/postinstall.in
@@ -89,6 +89,26 @@ if [ ! "${UPDATE}" = "1" ]; then
89 else 89 else
90 echo "Using existing DSA public/private host key pair for SSH-2." 90 echo "Using existing DSA public/private host key pair for SSH-2."
91 fi 91 fi
92 if [ ! -f "${CONFDIR}/ssh_host_rsa_key" ]; then
93 echo "Creating new RSA public/private host key pair for SSH-2."
94 $INSTALLF $PKGINST ${CONFDIR}/ssh_host_rsa_key
95 $INSTALLF $PKGINST ${CONFDIR}/ssh_host_rsa_key.pub
96 ### If there is *anything* there then leave it, otherwise look
97 ### in some reasonable alternate locations before giving up.
98 ### It's worth spending some extra time looking for the old one
99 ### to avoid a bunch of "host identification has changed" warnings.
100 ### Note that some old keys from the commercial SSH2 might not
101 ### be compatible, but we don't test for that.
102 if [ -f "${PKG_INSTALL_ROOT}/etc/ssh_host_rsa_key" ]; then
103 mv ${PKG_INSTALL_ROOT}/etc/ssh_host_rsa_key ${CONFDIR}
104 elif [ -f "${PKG_INSTALL_ROOT}/usr/local/etc/ssh_host_rsa_key" ]; then
105 mv ${PKG_INSTALL_ROOT}/usr/local/etc/ssh_host_rsa_key ${CONFDIR}
106 else
107 ${DESTBIN}/ssh-keygen -t rsa -f ${CONFDIR}/ssh_host_rsa_key -N ''
108 fi
109 else
110 echo "Using existing RSA public/private host key pair for SSH-2."
111 fi
92else 112else
93 echo "Performing an \"update\" installation of OpenSSH." 113 echo "Performing an \"update\" installation of OpenSSH."
94 ### Okay, this part *is* an update install...so we need to ensure 114 ### Okay, this part *is* an update install...so we need to ensure
@@ -178,6 +198,26 @@ else
178 else 198 else
179 echo "Using existing DSA public/private host key pair for SSH-2." 199 echo "Using existing DSA public/private host key pair for SSH-2."
180 fi 200 fi
201 if [ ! -f "${CONFDIR}/ssh_host_rsa_key" ]; then
202 echo "Creating new RSA public/private host key pair for SSH-2."
203 $INSTALLF $PKGINST ${CONFDIR}/ssh_host_rsa_key
204 $INSTALLF $PKGINST ${CONFDIR}/ssh_host_rsa_key.pub
205 ### If there is *anything* there then leave it, otherwise look
206 ### in some reasonable alternate locations before giving up.
207 ### It's worth spending some extra time looking for the old one
208 ### to avoid a bunch of "host identification has changed" warnings.
209 ### Note that some old keys from the commercial SSH2 might not
210 ### be compatible, but we don't test for that.
211 if [ -f "${PKG_INSTALL_ROOT}/etc/ssh_host_rsa_key" ]; then
212 mv ${PKG_INSTALL_ROOT}/etc/ssh_host_rsa_key ${CONFDIR}
213 elif [ -f "${PKG_INSTALL_ROOT}/usr/local/etc/ssh_host_rsa_key" ]; then
214 mv ${PKG_INSTALL_ROOT}/usr/local/etc/ssh_host_rsa_key ${CONFDIR}
215 else
216 ${DESTBIN}/ssh-keygen -d -f ${CONFDIR}/ssh_host_rsa_key -N ''
217 fi
218 else
219 echo "Using existing RSA public/private host key pair for SSH-2."
220 fi
181fi 221fi
182 222
183if [ ! -d %%PIDDIR%% ]; then 223if [ ! -d %%PIDDIR%% ]; then