source: clfs-embedded/bootscripts/clfs/rc.d/init.d/sshd@ 12fe1e5

Last change on this file since 12fe1e5 was 381c53b, checked in by Jim Gifford <clfs@…>, 18 years ago

Updates to bootscripts

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