diff options
author | jlam <jlam@pkgsrc.org> | 2001-08-14 21:42:14 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2001-08-14 21:42:14 +0000 |
commit | 04b5c4360c08dc8b23056cc444321f6d4fa88c59 (patch) | |
tree | 2149231798aebf922ab3ff8a1d402d09661b358c /mail/courier-imap/files/courierimap.sh | |
parent | de6db1ce8153c27cd976d3dfba2a0223f89554e0 (diff) | |
download | pkgsrc-04b5c4360c08dc8b23056cc444321f6d4fa88c59.tar.gz |
Remove useless courier-imap.sh that was a work-in-progress, and add
four scripts (courier-{imap,imaps,pop,pops}) that are rc.d-style scripts
to start/stop the various Courier IMAP and POP3 services. They were
modelled after the samba scripts which may be invoked on systems without
rc.d.
Diffstat (limited to 'mail/courier-imap/files/courierimap.sh')
-rwxr-xr-x | mail/courier-imap/files/courierimap.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mail/courier-imap/files/courierimap.sh b/mail/courier-imap/files/courierimap.sh new file mode 100755 index 00000000000..31f9da5eaa5 --- /dev/null +++ b/mail/courier-imap/files/courierimap.sh @@ -0,0 +1,40 @@ +#! /bin/sh +# +# Courier IMAP services daemon +# +# PROVIDE: courierimap +# REQUIRE: DAEMON + +if [ ! -d /etc/rc.d -a -f /etc/rc.subr ] +then + . /etc/rc.subr +fi + +name="courierimap" +rcvar=${name} +command="/usr/pkg/libexec/courier/couriertcpd" +ctl_command="/usr/pkg/libexec/courier/imapd.rc" +pidfile="/var/run/imapd.pid" + +start_cmd="courier_doit start" +stop_cmd="courier_doit stop" + +courier_doit() +{ + action=$1 + case ${action} in + start) echo "Starting ${rcvar}." ;; + stop) echo "Stopping ${rcvar}." ;; + esac + + ${ctl_command} ${action} +} + +if [ ! -d /etc/rc.d ] +then + echo -n " ${name}" + exec ${ctl_command} start +fi + +load_rc_config $name +run_rc_command "$1" |