Last change
on this file since 929589c was 292c832, checked in by Andrew Bradford <bradfa@…>, 14 years ago |
Imported updates of existing bootscripts
Imported bootscripts that already existed from clfs-embedded/bootscripts
as bootscripts should be kept in this repo rather than in the
clfs-embedded repo.
The script changes have NOT BEEN TESTED! (yet)
This is part of a cleanup of bootscripts.
|
-
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 |
|
---|
7 | DSSKEY=/etc/dropbear/dropbear_dss_host_key
|
---|
8 | RSAKEY=/etc/dropbear/dropbear_rsa_host_key
|
---|
9 | PIDFILE=/var/run/dropbear.pid
|
---|
10 |
|
---|
11 | case "$1" in
|
---|
12 | start)
|
---|
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 | ;;
|
---|
31 | stop)
|
---|
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 | ;;
|
---|
40 | restart)
|
---|
41 | $0 stop
|
---|
42 | $0 start
|
---|
43 | ;;
|
---|
44 | status)
|
---|
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
|
---|
54 | esac
|
---|
Note:
See
TracBrowser
for help on using the repository browser.