aboutsummaryrefslogtreecommitdiffstats
path: root/extra/dropbear/dropbear.initd
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2009-01-20 17:59:17 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-21 13:19:06 +0000
commit21fe03b1e9781313cf1c53670c8b228a1c87da3a (patch)
treebaae3608d88ebb73235dcd74779a4d62cc7027cf /extra/dropbear/dropbear.initd
parent0565c7e76b22581f280948669aa997c4db06a49a (diff)
downloadaports-21fe03b1e9781313cf1c53670c8b228a1c87da3a.tar.gz
aports-21fe03b1e9781313cf1c53670c8b228a1c87da3a.tar.bz2
aports-21fe03b1e9781313cf1c53670c8b228a1c87da3a.tar.xz
extra/dropbear new aport
Diffstat (limited to 'extra/dropbear/dropbear.initd')
-rw-r--r--extra/dropbear/dropbear.initd36
1 files changed, 36 insertions, 0 deletions
diff --git a/extra/dropbear/dropbear.initd b/extra/dropbear/dropbear.initd
new file mode 100644
index 0000000000..afdee8c6d3
--- /dev/null
+++ b/extra/dropbear/dropbear.initd
@@ -0,0 +1,36 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dropbear/files/dropbear.init.d,v 1.2 2004/07/14 23:57:35 agriffis Exp $
+
+depend() {
+ use logger dns
+ need net
+}
+
+check_config() {
+ if [ ! -e /etc/dropbear/ ] ; then
+ mkdir /etc/dropbear/
+ fi
+ if [ ! -e /etc/dropbear/dropbear_dss_host_key ] ; then
+ einfo "Generating DSS-Hostkey..."
+ /usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
+ fi
+ if [ ! -e /etc/dropbear/dropbear_rsa_host_key ] ; then
+ einfo "Generating RSA-Hostkey..."
+ /usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
+ fi
+}
+
+start() {
+ check_config || return 1
+ ebegin "Starting dropbear"
+ /usr/sbin/dropbear ${DROPBEAR_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dropbear"
+ start-stop-daemon --stop --pidfile /var/run/dropbear.pid
+ eend $?
+}