Last change
on this file since 4d57ce8 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
|
Rev | Line | |
---|
[a44b91b] | 1 | #!/bin/ash
|
---|
| 2 | #
|
---|
| 3 | # DropBear SSH
|
---|
| 4 |
|
---|
| 5 | . /etc/rc.d/init.d/functions
|
---|
| 6 |
|
---|
[30fbba8] | 7 | DSSKEY=/etc/dropbear/dropbear_dss_host_key
|
---|
| 8 | RSAKEY=/etc/dropbear/dropbear_rsa_host_key
|
---|
| 9 | PIDFILE=/var/run/dropbear.pid
|
---|
[a44b91b] | 10 |
|
---|
| 11 | case "$1" in
|
---|
| 12 | start)
|
---|
| 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 | ;;
|
---|
| 31 | stop)
|
---|
[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 | ;;
|
---|
| 40 | restart)
|
---|
| 41 | $0 stop
|
---|
| 42 | $0 start
|
---|
| 43 | ;;
|
---|
| 44 | status)
|
---|
[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
|
---|
| 54 | esac
|
---|
Note:
See
TracBrowser
for help on using the repository browser.