comparison debian/dropbear.init @ 330:5488db2e9e4e

merge of 332f709a4cb39cde4cedab7c3be89e05f3023067 and ca4ca78b82c5d430c69ce01bf794e8886ce81431
author Matt Johnston <matt@ucc.asn.au>
date Sat, 10 Jun 2006 16:39:40 +0000
parents c66797d973ff
children c23c7f0f594c
comparison
equal deleted inserted replaced
329:8ed0dce45126 330:5488db2e9e4e
14 14
15 set -e 15 set -e
16 16
17 cancel() { echo "$1" >&2; exit 0; }; 17 cancel() { echo "$1" >&2; exit 0; };
18 test ! -r /etc/default/dropbear || . /etc/default/dropbear 18 test ! -r /etc/default/dropbear || . /etc/default/dropbear
19 test "$NO_START" = "0" || cancel 'NO_START is not set to zero.'
20 test -x "$DAEMON" || cancel "$DAEMON does not exist or is not executable." 19 test -x "$DAEMON" || cancel "$DAEMON does not exist or is not executable."
21 test ! -h /var/service/dropbear || \ 20 test ! -h /var/service/dropbear || \
22 cancel '/var/service/dropbear exists, service is controlled through runit.' 21 cancel '/var/service/dropbear exists, service is controlled through runit.'
23 22
24 test -z "$DROPBEAR_BANNER" || \ 23 test -z "$DROPBEAR_BANNER" || \
28 test -n "$DROPBEAR_DSSKEY" || \ 27 test -n "$DROPBEAR_DSSKEY" || \
29 DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key" 28 DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key"
30 29
31 case "$1" in 30 case "$1" in
32 start) 31 start)
32 test "$NO_START" = "0" || cancel 'NO_START is not set to zero.'
33 echo -n "Starting $DESC: " 33 echo -n "Starting $DESC: "
34 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \ 34 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \
35 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \ 35 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \
36 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS 36 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
37 echo "$NAME." 37 echo "$NAME."
40 echo -n "Stopping $DESC: " 40 echo -n "Stopping $DESC: "
41 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid 41 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid
42 echo "$NAME." 42 echo "$NAME."
43 ;; 43 ;;
44 restart|force-reload) 44 restart|force-reload)
45 test "$NO_START" = "0" || cancel 'NO_START is not set to zero.'
45 echo -n "Restarting $DESC: " 46 echo -n "Restarting $DESC: "
46 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid 47 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid
47 sleep 1 48 sleep 1
48 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \ 49 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \
49 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \ 50 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \