summaryrefslogtreecommitdiff
path: root/mail/qmail-run/files/qmailqread.sh
blob: 81007c75319921617e1949724641a7378e3b4f38 (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
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: qmailqread.sh,v 1.1.1.1 2004/08/02 03:59:21 schmonz Exp $
#
# Script to control a service providing local non-root users access
# to see the queue. Adapted from a script by Steinar Haug.
#

# PROVIDE: qmailqread mail
# REQUIRE: qmailsend

. /etc/rc.subr

name="qmailqread"
rcvar=${name}
command="@LOCALBASE@/bin/tcpserver"
procname=${name}
start_precmd="qmailqread_precmd"

# User-settable rc.conf variables and their default values:
qmailqread_logcmd=${qmailqread_logcmd-"@LOCALBASE@/bin/setuidgid qmaill @LOCALBASE@/bin/splogger nb${name}"}

qmailqread_precmd()
{
	command="@SETENV@ - @LOCALBASE@/bin/argv0 @LOCALBASE@/bin/tcpserver ${name} -R -1 -u `@ID@ -u qmails` -g `@ID@ -g qmails` 127.0.0.1 20025 @LOCALBASE@/bin/qmail-qread 2>&1 | ${qmailqread_logcmd}"
	command_args="&"
	rc_flags=""
}

load_rc_config $name
run_rc_command "$1"