Mercurial > dropbear
comparison debian/dropbear.init @ 263:c66797d973ff
* Update to debian 0.46-2
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 08 Dec 2005 08:17:42 +0000 |
parents | 3ee0c2f85e1e |
children | c23c7f0f594c |
comparison
equal
deleted
inserted
replaced
262:a3a68c25035e | 263:c66797d973ff |
---|---|
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" \ |