fe823b6374
The current SysV startup script create a directory which is necessary for dropbear to correctly work. This creation is not done with systemd. Instead of both init creating the directory, we add the creation of this directory to the INSTALL_TARGET_CMDS to make sure it's present. [Peter: use make syntax for TARGET_DIR as pointed out by Thomas] Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
44 lines
699 B
Bash
44 lines
699 B
Bash
#!/bin/sh
|
|
#
|
|
# Starts dropbear sshd.
|
|
#
|
|
|
|
# Allow a few customizations from a config file
|
|
test -r /etc/default/dropbear && . /etc/default/dropbear
|
|
|
|
start() {
|
|
DROPBEAR_ARGS="$DROPBEAR_ARGS -R"
|
|
|
|
echo -n "Starting dropbear sshd: "
|
|
umask 077
|
|
start-stop-daemon -S -q -p /var/run/dropbear.pid \
|
|
--exec /usr/sbin/dropbear -- $DROPBEAR_ARGS
|
|
[ $? == 0 ] && echo "OK" || echo "FAIL"
|
|
}
|
|
stop() {
|
|
echo -n "Stopping dropbear sshd: "
|
|
start-stop-daemon -K -q -p /var/run/dropbear.pid
|
|
[ $? == 0 ] && echo "OK" || echo "FAIL"
|
|
}
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|reload)
|
|
restart
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|