3 # skeleton example file to build /etc/init.d/ scripts.
4 # This file should be used to construct scripts for /etc/init.d.
6 # Written by Miquel van Smoorenburg <miquels@cistron.nl>.
8 # by Ian Murdock <imurdock@gnu.ai.mit.edu>.
10 # Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
14 # Do not configure this file. Edit /etc/default/dropbear instead!
17 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
18 DAEMON=/usr/sbin/dropbear
20 DESC="Dropbear SSH server"
26 test -f /etc/default/dropbear && . /etc/default/dropbear
28 if [ -n "$DROPBEAR_BANNER" ]; then
29 DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
32 if [ -z "$DROPBEAR_RSAKEY" ]; then
33 DROPBEAR_RSAKEY="/etc/dropbear/dropbear_rsa_host_key"
36 if [ -z "$DROPBEAR_DSSKEY" ]; then
37 DROPBEAR_DSSKEY="/etc/dropbear/dropbear_dss_host_key"
40 test "$NO_START" != "0" && exit 0
42 test -x $DAEMON || exit 0
46 echo -n "Starting $DESC: "
47 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
52 echo -n "Stopping $DESC: "
53 start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/$NAME.pid
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".
62 echo -n "Restarting $DESC: "
63 start-stop-daemon --stop --quiet --oknodo --pidfile \
66 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
72 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
73 echo "Usage: $N {start|stop|restart|force-reload}" >&2