diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /mail-filter/milter-regex/files/milter-regex-init |
reinit the tree, so we can have metadata
Diffstat (limited to 'mail-filter/milter-regex/files/milter-regex-init')
-rw-r--r-- | mail-filter/milter-regex/files/milter-regex-init | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/mail-filter/milter-regex/files/milter-regex-init b/mail-filter/milter-regex/files/milter-regex-init new file mode 100644 index 000000000000..7528e625d2d6 --- /dev/null +++ b/mail-filter/milter-regex/files/milter-regex-init @@ -0,0 +1,41 @@ +#!/sbin/openrc-run +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + use dns logger net +} + +check_cfg() { + if [ -z "${USER}" ] ; then + eerror "USER is unset" + return 1 + fi + + if [ ! -s "${CONFIG}" ]; then + eerror "configuration file ${CONFIG} doesn't seem to be valid" + return 1 + fi +} + +start() { + check_cfg || return 1 + + # Remove stalled Unix socket if no other process is using it + if [ -S "${SOCKET}" ] && ! fuser -s "${SOCKET}"; then + rm "${SOCKET}" + fi + + ebegin "Starting milter-regex" + start-stop-daemon --start --exec /usr/bin/milter-regex -- \ + -u "${USER}" -p "${SOCKET}" -c "${CONFIG}" + EXIT=$? + [ $? == 0 ] && chmod a+rw "${SOCKET}" + eend ${EXIT} +} + +stop() { + ebegin "Stopping milter-regex" + start-stop-daemon --stop --exec /usr/bin/milter-regex + eend $? +} |