Mercurial > dropbear
comparison debian/dropbear.init @ 478:d4f32c3443ac dbclient-netcat-alike
propagate from branch 'au.asn.ucc.matt.dropbear' (head f21045c791002d81fc6b8dde6537ea481e513eb2)
to branch 'au.asn.ucc.matt.dropbear.dbclient-netcat-alike' (head d1f69334581dc4c35f9ca16aa5355074c9dd315d)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 14 Sep 2008 06:47:51 +0000 |
parents | 8c2d2edadf2a |
children | 3c3cef8a32e6 4ca2872c7d9e |
comparison
equal
deleted
inserted
replaced
296:6b41e2cbf071 | 478:d4f32c3443ac |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 ### BEGIN INIT INFO | |
3 # Provides: dropbear | |
4 # Required-Start: $remote_fs $syslog | |
5 # Required-Stop: $remote_fs $syslog | |
6 # Default-Start: 2 3 4 5 | |
7 # Default-Stop: 0 1 6 | |
8 ### END INIT INFO | |
2 # | 9 # |
3 # Do not configure this file. Edit /etc/default/dropbear instead! | 10 # Do not configure this file. Edit /etc/default/dropbear instead! |
4 # | 11 # |
5 | 12 |
6 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | 13 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin |
15 set -e | 22 set -e |
16 | 23 |
17 cancel() { echo "$1" >&2; exit 0; }; | 24 cancel() { echo "$1" >&2; exit 0; }; |
18 test ! -r /etc/default/dropbear || . /etc/default/dropbear | 25 test ! -r /etc/default/dropbear || . /etc/default/dropbear |
19 test -x "$DAEMON" || cancel "$DAEMON does not exist or is not executable." | 26 test -x "$DAEMON" || cancel "$DAEMON does not exist or is not executable." |
20 test ! -h /var/service/dropbear || \ | 27 test ! -x /usr/sbin/update-service || ! update-service --check dropbear || |
21 cancel '/var/service/dropbear exists, service is controlled through runit.' | 28 cancel 'The dropbear service is controlled through runit, use the sv(8) program' |
22 | 29 |
23 test -z "$DROPBEAR_BANNER" || \ | 30 test -z "$DROPBEAR_BANNER" || \ |
24 DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER" | 31 DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER" |
25 test -n "$DROPBEAR_RSAKEY" || \ | 32 test -n "$DROPBEAR_RSAKEY" || \ |
26 DROPBEAR_RSAKEY="/etc/dropbear/dropbear_rsa_host_key" | 33 DROPBEAR_RSAKEY="/etc/dropbear/dropbear_rsa_host_key" |
27 test -n "$DROPBEAR_DSSKEY" || \ | 34 test -n "$DROPBEAR_DSSKEY" || \ |
28 DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key" | 35 DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key" |
36 test -n "$DROPBEAR_RECEIVE_WINDOW" || \ | |
37 DROPBEAR_RECEIVE_WINDOW="65536" | |
29 | 38 |
30 case "$1" in | 39 case "$1" in |
31 start) | 40 start) |
32 test "$NO_START" = "0" || cancel 'NO_START is not set to zero.' | 41 test "$NO_START" = "0" || cancel 'NO_START is not set to zero.' |
33 echo -n "Starting $DESC: " | 42 echo -n "Starting $DESC: " |
34 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \ | 43 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \ |
35 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \ | 44 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \ |
36 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS | 45 -p "$DROPBEAR_PORT" -W "$DROPBEAR_RECEIVE_WINDOW" $DROPBEAR_EXTRA_ARGS |
37 echo "$NAME." | 46 echo "$NAME." |
38 ;; | 47 ;; |
39 stop) | 48 stop) |
40 echo -n "Stopping $DESC: " | 49 echo -n "Stopping $DESC: " |
41 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid | 50 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid |
46 echo -n "Restarting $DESC: " | 55 echo -n "Restarting $DESC: " |
47 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid | 56 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid |
48 sleep 1 | 57 sleep 1 |
49 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \ | 58 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \ |
50 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \ | 59 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \ |
51 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS | 60 -p "$DROPBEAR_PORT" -W "$DROPBEAR_RECEIVE_WINDOW" $DROPBEAR_EXTRA_ARGS |
52 echo "$NAME." | 61 echo "$NAME." |
53 ;; | 62 ;; |
54 *) | 63 *) |
55 N=/etc/init.d/$NAME | 64 N=/etc/init.d/$NAME |
56 echo "Usage: $N {start|stop|restart|force-reload}" >&2 | 65 echo "Usage: $N {start|stop|restart|force-reload}" >&2 |