source: clfs-embedded/bootscripts/clfs/rc.d/init.d/sshd@ 78aecb6

Last change on this file since 78aecb6 was 30fbba8, checked in by Maarten Lankhorst <m.b.lankhorst@…>, 18 years ago

Fix dropbear

  • Property mode set to 100755
File size: 1.0 KB
Line 
1#!/bin/ash
2#
3# DropBear SSH
4
5. /etc/rc.d/init.d/functions
6
7DSSKEY=/etc/dropbear/dropbear_dss_host_key
8RSAKEY=/etc/dropbear/dropbear_rsa_host_key
9PIDFILE=/var/run/dropbear.pid
10
11case "$1" in
12start)
13 if [ ! -r "$DSSKEY" ]; then
14 echo -n "Generating DSS host key: "
15 dropbearkey -t dss -f "$DSSKEY" >/dev/null 2>&1
16 check_status
17 fi
18 if [ ! -r "$RSAKEY" ]; then
19 echo -n "Generating RSA host key: "
20 dropbearkey -t rsa -f "$RSAKEY" >/dev/null 2>&1
21 check_status
22 fi
23 if [ -r "$PIDFILE" ]; then
24 echo "Service dropbear already running."
25 else
26 echo -n "Starting SSH server: "
27 dropbear
28 check_status
29 fi
30 ;;
31stop)
32 if [ -r "$PIDFILE" ]; then
33 echo -n "Stopping dropbear SSH server: "
34 kill `cat "$PIDFILE"`
35 check_status
36 else
37 echo "Service dropbear not running."
38 fi
39 ;;
40restart)
41 $0 stop
42 $0 start
43 ;;
44status)
45 if [ -r "$PIDFILE" ]; then
46 echo "Service dropbear running (PID $(cat "$PIDFILE"))."
47 else
48 echo "Service dropbear not running."
49 fi
50 ;;
51*)
52 echo "Usage: $0 {start|stop|restart|status}"
53 exit 1
54esac
Note: See TracBrowser for help on using the repository browser.