Last change
on this file since ae024d6 was ae024d6, checked in by Jim Gifford <clfs@…>, 18 years ago |
Bootscripts Updates
|
-
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 | PATH=/bin:/sbin:/usr/bin:/usr/sbin
|
---|
8 |
|
---|
9 | DSSKEY=/etc/ssh/dss_host_key
|
---|
10 | RSAKEY=/etc/ssh/rsa_host_key
|
---|
11 |
|
---|
12 | case "$1" in
|
---|
13 | start)
|
---|
14 | if [ ! -r "$DSSKEY" ]; then
|
---|
15 | echo -n "Generating DSS host key: "
|
---|
16 | dropbearkey -t dss -f "$DSSKEY" &> /dev/null
|
---|
17 | check_status
|
---|
18 | fi
|
---|
19 | if [ ! -r "$RSAKEY" ]; then
|
---|
20 | echo -n "Generating RSA host key: "
|
---|
21 | dropbearkey -t rsa -f "$RSAKEY" &> /dev/null
|
---|
22 | check_status
|
---|
23 | fi
|
---|
24 | if [ -r /var/run/dropbear.pid ]; then
|
---|
25 | echo "Service sshd already running."
|
---|
26 | else
|
---|
27 | echo -n "Starting SSH server: "
|
---|
28 | dropbear
|
---|
29 | check_status
|
---|
30 | fi
|
---|
31 | ;;
|
---|
32 | stop)
|
---|
33 | if [ -r /var/run/dropbear.pid ]; then
|
---|
34 | echo -n "Stopping SSH server: "
|
---|
35 | kill `cat /var/run/dropbear.pid`
|
---|
36 | check_status
|
---|
37 | else
|
---|
38 | echo "Service sshd not running."
|
---|
39 | fi
|
---|
40 | ;;
|
---|
41 | restart)
|
---|
42 | $0 stop
|
---|
43 | $0 start
|
---|
44 | ;;
|
---|
45 | status)
|
---|
46 | if [ -r /var/run/dropbear.pid ]; then
|
---|
47 | echo "Service sshd running (PID `cat /var/run/dropbear.pid`)."
|
---|
48 | else
|
---|
49 | echo "Service sshd not running."
|
---|
50 | fi
|
---|
51 | ;;
|
---|
52 | *)
|
---|
53 | echo "Usage: $0 {start|stop|restart|status}"
|
---|
54 | exit 1
|
---|
55 | esac
|
---|
Note:
See
TracBrowser
for help on using the repository browser.