comparison debian/dropbear.init @ 70:b0316ce64e4b

Merging in the changes from 0.41-0.43 main Dropbear tree
author Matt Johnston <matt@ucc.asn.au>
date Thu, 12 Aug 2004 16:41:58 +0000
parents fe6bca95afa7
children 3ee0c2f85e1e
comparison
equal deleted inserted replaced
69:59d16db56e9f 70:b0316ce64e4b
1 #! /bin/sh 1 #!/bin/sh
2 #
3 # skeleton example file to build /etc/init.d/ scripts.
4 # This file should be used to construct scripts for /etc/init.d.
5 #
6 # Written by Miquel van Smoorenburg <[email protected]>.
7 # Modified for Debian
8 # by Ian Murdock <[email protected]>.
9 #
10 # Version: @(#)skeleton 1.9 26-Feb-2001 [email protected]
11 #
12
13 # 2 #
14 # Do not configure this file. Edit /etc/default/dropbear instead! 3 # Do not configure this file. Edit /etc/default/dropbear instead!
15 # 4 #
16 5
17 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 6 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
20 DESC="Dropbear SSH server" 9 DESC="Dropbear SSH server"
21 10
22 DROPBEAR_PORT=22 11 DROPBEAR_PORT=22
23 DROPBEAR_EXTRA_ARGS= 12 DROPBEAR_EXTRA_ARGS=
24 NO_START=0 13 NO_START=0
14
25 set -e 15 set -e
26 test -f /etc/default/dropbear && . /etc/default/dropbear
27 16
28 if [ -n "$DROPBEAR_BANNER" ]; then 17 test ! -r /etc/default/dropbear || . /etc/default/dropbear
29 DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER" 18 test "$NO_START" = "0" || exit 0
30 fi 19 test -x "$DAEMON" || exit 0
20 test ! -h /var/service/dropbear || exit 0
31 21
32 if [ -z "$DROPBEAR_RSAKEY" ]; then 22 test -z "$DROPBEAR_BANNER" || \
33 DROPBEAR_RSAKEY="/etc/dropbear/dropbear_rsa_host_key" 23 DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
34 fi 24 test -n "$DROPBEAR_RSAKEY" || \
35 25 DROPBEAR_RSAKEY="/etc/dropbear/dropbear_rsa_host_key"
36 if [ -z "$DROPBEAR_DSSKEY" ]; then 26 test -n "$DROPBEAR_DSSKEY" || \
37 DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key" 27 DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key"
38 fi
39
40 test "$NO_START" != "0" && exit 0
41
42 test -x $DAEMON || exit 0
43 28
44 case "$1" in 29 case "$1" in
45 start) 30 start)
46 echo -n "Starting $DESC: " 31 echo -n "Starting $DESC: "
47 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ 32 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \
48 --exec $DAEMON -- -d $DROPBEAR_DSSKEY -r $DROPBEAR_RSAKEY -p $DROPBEAR_PORT $DROPBEAR_EXTRA_ARGS 33 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \
34 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
49 echo "$NAME." 35 echo "$NAME."
50 ;; 36 ;;
51 stop) 37 stop)
52 echo -n "Stopping $DESC: " 38 echo -n "Stopping $DESC: "
53 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/$NAME.pid 39 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid
54 echo "$NAME." 40 echo "$NAME."
55 ;; 41 ;;
56 restart|force-reload) 42 restart|force-reload)
57 #
58 # If the "reload" option is implemented, move the "force-reload"
59 # option to the "reload" entry above. If not, "force-reload" is
60 # just the same as "restart".
61 #
62 echo -n "Restarting $DESC: " 43 echo -n "Restarting $DESC: "
63 start-stop-daemon --stop --quiet --oknodo --pidfile \ 44 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid
64 /var/run/$NAME.pid
65 sleep 1 45 sleep 1
66 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ 46 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \
67 --exec $DAEMON -- -d $DROPBEAR_DSSKEY -r $DROPBEAR_RSAKEY -p $DROPBEAR_PORT $DROPBEAR_EXTRA_ARGS 47 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \
48 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
68 echo "$NAME." 49 echo "$NAME."
69 ;; 50 ;;
70 *) 51 *)
71 N=/etc/init.d/$NAME 52 N=/etc/init.d/$NAME
72 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
73 echo "Usage: $N {start|stop|restart|force-reload}" >&2 53 echo "Usage: $N {start|stop|restart|force-reload}" >&2
74 exit 1 54 exit 1
75 ;; 55 ;;
76 esac 56 esac
77 57