3 # Do not configure this file. Edit /etc/default/dropbear instead!
6 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
7 DAEMON=/usr/sbin/dropbear
9 DESC="Dropbear SSH server"
17 cancel() { echo "$1" >&2; exit 0; };
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."
21 test ! -h /var/service/dropbear || \
22 cancel '/var/service/dropbear exists, service is controlled through runit.'
24 test -z "$DROPBEAR_BANNER" || \
25 DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
26 test -n "$DROPBEAR_RSAKEY" || \
27 DROPBEAR_RSAKEY="/etc/dropbear/dropbear_rsa_host_key"
28 test -n "$DROPBEAR_DSSKEY" || \
29 DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key"
33 echo -n "Starting $DESC: "
34 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \
35 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \
36 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
40 echo -n "Stopping $DESC: "
41 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid
45 echo -n "Restarting $DESC: "
46 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/"$NAME".pid
48 start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \
49 --exec "$DAEMON" -- -d "$DROPBEAR_DSSKEY" -r "$DROPBEAR_RSAKEY" \
50 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
55 echo "Usage: $N {start|stop|restart|force-reload}" >&2