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

Last change on this file since 6533111 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
RevLine 
[a44b91b]1#!/bin/ash
2#
3# DropBear SSH
4
5. /etc/rc.d/init.d/functions
6
[30fbba8]7DSSKEY=/etc/dropbear/dropbear_dss_host_key
8RSAKEY=/etc/dropbear/dropbear_rsa_host_key
9PIDFILE=/var/run/dropbear.pid
[a44b91b]10
11case "$1" in
12start)
13 if [ ! -r "$DSSKEY" ]; then
14 echo -n "Generating DSS host key: "
[30fbba8]15 dropbearkey -t dss -f "$DSSKEY" >/dev/null 2>&1
[a44b91b]16 check_status
17 fi
18 if [ ! -r "$RSAKEY" ]; then
19 echo -n "Generating RSA host key: "
[30fbba8]20 dropbearkey -t rsa -f "$RSAKEY" >/dev/null 2>&1
[a44b91b]21 check_status
22 fi
[30fbba8]23 if [ -r "$PIDFILE" ]; then
24 echo "Service dropbear already running."
[a44b91b]25 else
26 echo -n "Starting SSH server: "
27 dropbear
28 check_status
29 fi
30 ;;
31stop)
[30fbba8]32 if [ -r "$PIDFILE" ]; then
33 echo -n "Stopping dropbear SSH server: "
34 kill `cat "$PIDFILE"`
[a44b91b]35 check_status
36 else
[30fbba8]37 echo "Service dropbear not running."
[a44b91b]38 fi
39 ;;
40restart)
41 $0 stop
42 $0 start
43 ;;
44status)
[30fbba8]45 if [ -r "$PIDFILE" ]; then
46 echo "Service dropbear running (PID $(cat "$PIDFILE"))."
[a44b91b]47 else
[30fbba8]48 echo "Service dropbear not running."
[a44b91b]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.