summaryrefslogtreecommitdiff
path: root/security/cyrus-sasl/files/sasl_pwcheck.sh
blob: 32ea60034f94006a5a2371f706aed51995dd141e (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
33
34
35
36
37
38
39
#! /bin/sh
#
# $NetBSD: sasl_pwcheck.sh,v 1.9 2002/08/25 18:39:51 jlam Exp $
#
# The pwcheck daemon allows UNIX password authentication with Cyrus SASL.
#
# PROVIDE: sasl_pwcheck
# REQUIRE: DAEMON

if [ -f /etc/rc.subr ]
then
	. /etc/rc.subr
fi

name="sasl_pwcheck"
rcvar="${name}"
command="@PREFIX@/sbin/pwcheck"
command_args="& sleep 2"
start_precmd=sasl_pwcheck_precmd

sasl_pwcheck_precmd()
{
	if [ ! -d @SASLSOCKETDIR@ ]
	then
		@MKDIR@ @SASLSOCKETDIR@
		@CHMOD@ 0700 @SASLSOCKETDIR@
		@CHOWN@ @CYRUS_USER@ @SASLSOCKETDIR@
	fi
}

if [ -f /etc/rc.subr ]
then
	load_rc_config $name
	run_rc_command "$1"
else
	@ECHO@ -n " ${name}"
	eval ${start_precmd}
	${command} ${sasl_pwcheck_flags} ${command_args}
fi