Last change
on this file since 5d96f6a was f25bf53, checked in by Jim Gifford <clfs@…>, 16 years ago |
Formatting change to embedded
|
-
Property mode
set to
100755
|
File size:
1.1 KB
|
Rev | Line | |
---|
[97ad60e] | 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)
|
---|
[f25bf53] | 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 dropbear SSH server: "
|
---|
| 27 | dropbear
|
---|
| 28 | check_status
|
---|
| 29 | fi
|
---|
| 30 | ;;
|
---|
[97ad60e] | 31 | stop)
|
---|
[f25bf53] | 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 | ;;
|
---|
[97ad60e] | 40 | restart)
|
---|
[f25bf53] | 41 | $0 stop
|
---|
| 42 | $0 start
|
---|
| 43 | ;;
|
---|
[97ad60e] | 44 | status)
|
---|
[f25bf53] | 45 | if [ -r "$PIDFILE" ]; then
|
---|
| 46 | echo "Service dropbear running (PID $(cat "$PIDFILE"))."
|
---|
| 47 | else
|
---|
| 48 | echo "Service dropbear not running."
|
---|
| 49 | fi
|
---|
| 50 | ;;
|
---|
[97ad60e] | 51 | *)
|
---|
[f25bf53] | 52 | echo "Usage: $0 {start|stop|restart|status}"
|
---|
| 53 | exit 1
|
---|
[97ad60e] | 54 | esac
|
---|
Note:
See
TracBrowser
for help on using the repository browser.