pass ARCH down to uClibc
[buildroot.git] / package / openssh / S50sshd
blob3821449fbffb4650b9bacd13022200207cdb9707
1 #!/bin/sh
3 # sshd Starts sshd.
6 # Make sure the ssh-keygen progam exists
7 [ -f /usr/bin/ssh-keygen ] || exit 0
9 # Check for the SSH1 RSA key
10 if [ ! -f /etc/ssh_host_key ] ; then
11 echo Generating RSA Key...
12 /usr/bin/ssh-keygen -t rsa1 -f /etc/ssh_host_key -C '' -N ''
15 # Check for the SSH2 RSA key
16 if [ ! -f /etc/ssh_host_rsa_key ] ; then
17 echo Generating RSA Key...
18 /usr/bin/ssh-keygen -t rsa -f /etc/ssh_host_rsa_key -C '' -N ''
21 # Check for the SSH2 DSA key
22 if [ ! -f /etc/ssh_host_dsa_key ] ; then
23 echo Generating DSA Key...
24 echo THIS CAN TAKE A MINUTE OR TWO DEPENDING ON YOUR PROCESSOR!
25 echo
26 /usr/bin/ssh-keygen -t dsa -f /etc/ssh_host_dsa_key -C '' -N ''
29 umask 077
31 start() {
32 echo -n "Starting sshd: "
33 /usr/sbin/sshd
34 touch /var/lock/sshd
35 echo "OK"
37 stop() {
38 echo -n "Stopping sshd: "
39 killall sshd
40 rm -f /var/lock/sshd
41 echo "OK"
43 restart() {
44 stop
45 start
48 case "$1" in
49 start)
50 start
52 stop)
53 stop
55 restart|reload)
56 restart
59 echo $"Usage: $0 {start|stop|restart}"
60 exit 1
61 esac
63 exit $?