Update to 5.0.

I've decided to change BASEDIR to / and take all the init scripts and stuff
out of the postintall script. This marks a change from how opensshs own
make package target does it.
This commit is contained in:
Tom G. Christensen
2008-04-28 19:26:05 +00:00
committed by tgc
parent ee8cca6cfc
commit b541704ca1
8 changed files with 191 additions and 141 deletions

View File

@@ -1,13 +1,42 @@
#!/bin/sh
# Script to control ssh server start/stop
# History:
# Please see CVS for history information
# Written by Tom G. Christensen <swpkg@jupiterrise.com>
SSHD=/usr/local/sbin/sshd
SSHD=/usr/tgcware/sbin/sshd
KEYGEN=/usr/tgcware/bin/ssh-keygen
RSA1_KEY=/usr/tgcware/etc/ssh/ssh_host_key
RSA_KEY=/usr/tgcware/etc/ssh/ssh_host_rsa_key
DSA_KEY=/usr/tgcware/etc/ssh/ssh_host_dsa_key
ECHO=/usr/bin/echo
pidfile=/var/run/sshd.pid
check_pid_dir()
{
if [ ! -d /var/run ]; then
mkdir -p /var/run
chown root.sys /var/run
chmod 755 /var/run
fi
}
do_hostkeygen()
{
if [ ! -s $RSA1_KEY ]; then
$ECHO "Generating $RSA1_KEY: "
$KEYGEN -q -t rsa1 -f $RSA1_KEY -N '' > /dev/null 2>&1
fi
if [ ! -s $RSA_KEY ]; then
$ECHO "Generating $RSA_KEY: "
$KEYGEN -q -t rsa -f $RSA_KEY -N '' > /dev/null 2>&1
fi
if [ ! -s $DSA_KEY ]; then
$ECHO "Generating $DSA_KEY: "
$KEYGEN -q -t dsa -f $DSA_KEY -N '' > /dev/null 2>&1
fi
}
kill_sshd()
{
if [ -r $pidfile ]; then
@@ -26,9 +55,14 @@ if [ $1 = "0" ]; then
case $mode in
start)
kill_sshd
echo "Starting sshd"
$SSHD
;;
if test -x $SSHD; then
$ECHO "Starting sshd:\c"
do_hostkeygen
check_pid_dir
$SSHD
$ECHO "."
fi
;;
stop)
kill_sshd
exit 0