CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Imported core-cross ports from 2.5
[crossrootfs.git] / dropbear / dropbear
CommitLineData
6dca1d21
JB
1#!/bin/sh
2#
3# /etc/rc.d/dropbear: start/stop dropbear ssh daemon
4#
5
6CONV=/usr/bin/dropbearconvert
7KEYG=/usr/bin/dropbearkey
8
9RSA=/etc/dropbear/dropbear_rsa_host_key
10DSS=/etc/dropbear/dropbear_dss_host_key
11
12case $1 in
13start)
14 if [ ! -f $RSA ]; then
15 if [ -f /etc/ssh/ssh_host_rsa_key ]; then
16 $CONV openssh dropbear /etc/ssh/ssh_host_rsa_key $RSA
17 else
18 $KEYG -t rsa -f $RSA
19 fi
20 fi
21 if [ ! -f $DSS ]; then
22 if [ -f /etc/ssh/ssh_host_dsa_key ]; then
23 $CONV openssh dropbear /etc/ssh/ssh_host_dsa_key $DSS
24 else
25 $KEYG -t dss -f $DSS
26 fi
27 fi
28 /usr/sbin/dropbear
29 ;;
30stop)
31 killall -q /usr/sbin/dropbear
32 ;;
33restart)
34 $0 stop
35 sleep 2
36 $0 start
37 ;;
38*)
39 echo "usage: $0 [start|stop|restart]"
40 ;;
41esac
42
43# End of file