summaryrefslogtreecommitdiff
blob: c2d666c8e238029a99044bf7056d7c8eacf26c8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/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/lsh/files/lsh.rc,v 1.1 2004/11/23 02:47:12 vapier Exp $

depend() {
	use logger dns net
}

check_config() {
	local vardir="/var/spool/lsh"
	[ ! -d ${vardir} ] && mkdir ${vardir}
	[ ! -e ${vardir}/yarrow-seed-file ] && lsh-make-seed -o ${vardir}/yarrow-seed-file
	if [ ! -e /etc/lsh_host_key ] ; then
		einfo "Generating DSA-Hostkey..."
		/usr/bin/lsh-keygen --server -a dsa -l 8 -q | /usr/bin/lsh-writekey --server -q
	fi
	return 0
}

start() {
	check_config || return 1
	ebegin "Starting lshd"
	/usr/sbin/lshd --daemonic ${LSHD_OPTS}
	eend $?
}

stop() {
	ebegin "Stopping lshd"
	start-stop-daemon --stop --pidfile /var/run/lshd.pid
	eend $?
}