2008-04-09 09:35:12 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Starts dropbear sshd.
|
|
|
|
#
|
|
|
|
|
|
|
|
start() {
|
|
|
|
echo -n "Starting dropbear sshd: "
|
|
|
|
# Make sure dropbear directory exists
|
|
|
|
if [ ! -d /etc/dropbear ] ; then
|
|
|
|
mkdir -p /etc/dropbear
|
|
|
|
fi
|
|
|
|
umask 077
|
2013-12-04 14:24:00 +01:00
|
|
|
start-stop-daemon -S -q -p /var/run/dropbear.pid --exec /usr/sbin/dropbear -- -R
|
|
|
|
[ $? == 0 ] && echo "OK" || echo "FAIL"
|
2008-04-09 09:35:12 +02:00
|
|
|
}
|
|
|
|
stop() {
|
|
|
|
echo -n "Stopping dropbear sshd: "
|
|
|
|
start-stop-daemon -K -q -p /var/run/dropbear.pid
|
2013-12-04 14:24:00 +01:00
|
|
|
[ $? == 0 ] && echo "OK" || echo "FAIL"
|
2008-04-09 09:35:12 +02:00
|
|
|
}
|
|
|
|
restart() {
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
restart|reload)
|
|
|
|
restart
|
|
|
|
;;
|
|
|
|
*)
|
2012-03-15 22:08:09 +01:00
|
|
|
echo "Usage: $0 {start|stop|restart}"
|
2008-04-09 09:35:12 +02:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $?
|