summaryrefslogtreecommitdiff
path: root/package/dropbear/dropbear-init.patch
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-10-29 07:01:33 +0000
committerMike Frysinger <vapier@gentoo.org>2005-10-29 07:01:33 +0000
commitd11b70150e5eda6f610e0f05f2554cd14373af69 (patch)
tree22510af5edb598b919134d3c197b12c4225410f1 /package/dropbear/dropbear-init.patch
parent06b151e5c90718786d0bdc90b30e3f753ad60ea0 (diff)
rename dropbear_sshd to just dropbear
Diffstat (limited to 'package/dropbear/dropbear-init.patch')
-rw-r--r--package/dropbear/dropbear-init.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/package/dropbear/dropbear-init.patch b/package/dropbear/dropbear-init.patch
new file mode 100644
index 000000000..d6bf1740a
--- /dev/null
+++ b/package/dropbear/dropbear-init.patch
@@ -0,0 +1,59 @@
+--- dropbear-0.42/S50dropbear
++++ dropbear-0.42/S50dropbear
+@@ -0,0 +1,56 @@
++#!/bin/sh
++#
++# Starts dropbear sshd.
++#
++
++# Make sure the dropbearkey progam exists
++[ -f /usr/bin/dropbearkey ] || exit 0
++
++# Check for the Dropbear RSA key
++if [ ! -f /etc/dropbear/dropbear_rsa_host_key ] ; then
++ echo Generating RSA Key...
++ mkdir -p /etc/dropbear
++ /usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
++fi
++
++# Check for the Dropbear DSS key
++if [ ! -f /etc/dropbear/dropbear_dss_host_key ] ; then
++ echo Generating DSS Key...
++ mkdir -p /etc/dropbear
++ /usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
++fi
++
++umask 077
++
++start() {
++ echo -n "Starting dropbear sshd: "
++ start-stop-daemon --start --quiet --pidfile /var/run/dropbear.pid --exec /usr/sbin/dropbear
++ echo "OK"
++}
++stop() {
++ echo -n "Stopping sshd: "
++ start-stop-daemon --stop --quiet --pidfile /var/run/dropbear.pid
++ echo "OK"
++}
++restart() {
++ stop
++ start
++}
++
++case "$1" in
++ start)
++ start
++ ;;
++ stop)
++ stop
++ ;;
++ restart|reload)
++ restart
++ ;;
++ *)
++ echo $"Usage: $0 {start|stop|restart}"
++ exit 1
++esac
++
++exit $?
++