summaryrefslogtreecommitdiff
path: root/security/cyrus-sasl/files/sasl_pwcheck.sh
blob: 77f421ae0ffa3d02f8ae52865c7d4e8ff02e40b4 (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
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: sasl_pwcheck.sh,v 1.10 2002/09/20 02:02:00 grant 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