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 /net-misc/capi4hylafax/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-misc/capi4hylafax/files')
-rw-r--r-- | net-misc/capi4hylafax/files/capi4hylafax.confd | 19 | ||||
-rw-r--r-- | net-misc/capi4hylafax/files/capi4hylafax.initd | 63 |
2 files changed, 82 insertions, 0 deletions
diff --git a/net-misc/capi4hylafax/files/capi4hylafax.confd b/net-misc/capi4hylafax/files/capi4hylafax.confd new file mode 100644 index 000000000000..40aa8cfe603d --- /dev/null +++ b/net-misc/capi4hylafax/files/capi4hylafax.confd @@ -0,0 +1,19 @@ +# configuraton file for /etc/init.d/capi4hylafax + +# Activate Logging (Filename have to be specified in the config file). +#ACTIVATE_LOGGING="yes" + +# Specify the output format. Allowed types are: +# HYLAFAX (default), TIFF, SFF, G3 +#OUTPUT_FORMAT="HYLAFAX" + +# Virtual device name only needed for Hylafax. +#VIRTUAL_DEVICE="faxCAPI" + +# Name and path of the config file +#CONFIG_FILE="/var/spool/fax/etc/config.faxCAPI" + +# Directory where received faxes are to be stored. +# Do not set it in Hylafax mode (see OUTPUT_FORMAT)! +#RECEIVE_DIR="/var/spool/fax/recvq" + diff --git a/net-misc/capi4hylafax/files/capi4hylafax.initd b/net-misc/capi4hylafax/files/capi4hylafax.initd new file mode 100644 index 000000000000..08c3917f6f8f --- /dev/null +++ b/net-misc/capi4hylafax/files/capi4hylafax.initd @@ -0,0 +1,63 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need capi +} + +checkconfig() { + local DEFAULT_OUTPUT_FORMAT="HYLAFAX" + local DEFAULT_VIRTUAL_DEVICE="faxCAPI" + local DEFAULT_RECEIVE_DIR="/var/spool/fax" + local DEFAULT_CONFIG_FILE="/var/spool/fax/etc/config.faxCAPI" + + [ -n "${CONFIG_FILE}" ] || CONFIG_FILE="${DEFAULT_CONFIG_FILE}" + [ -n "${OUTPUT_FORMAT}" ] || OUTPUT_FORMAT="${DEFAULT_OUTPUT_FORMAT}" + [ -n "${VIRTUAL_DEVICE}" ] || VIRTUAL_DEVICE="${DEFAULT_VIRTUAL_DEVICE}" + [ "${OUTPUT_FORMAT}" = "HYLAFAX" ] || DEFAULT_RECEIVE_DIR="/var/spool/fax/recvq" + [ -n "${RECEIVE_DIR}" ] || RECEIVE_DIR="${DEFAULT_RECEIVE_DIR}" + + if [ ! -f "${CONFIG_FILE}" ]; then + eerror "You're missing ${CONFIG_FILE}" + return 1 + fi + + OPTIONS="" + PIDFILE="/var/run/c2faxrecv.pid" + + [ "${ACTIVATE_LOGGING}" = "yes" ] && OPTIONS="${OPTIONS} -L" + + [ "${OUTPUT_FORMAT}" = "${DEFAULT_OUTPUT_FORMAT}" ] || \ + OPTIONS="${OPTIONS} -f ${OUTPUT_FORMAT}" + + [ "${CONFIG_FILE}" = "${DEFAULT_CONFIG_FILE}" ] || \ + OPTIONS="${OPTIONS} -C ${CONFIG_FILE}" + + [ "${OUTPUT_FORMAT}" = "HYLAFAX" -a "${RECEIVE_DIR}" = "${DEFAULT_RECEIVE_DIR}" ] || \ + OPTIONS="${OPTIONS} -q ${RECEIVE_DIR}" + + if [ "${VIRTUAL_DEVICE}" != "${DEFAULT_VIRTUAL_DEVICE}" ]; then + PIDFILE="/var/run/c2faxrecv.${VIRTUAL_DEVICE}.pid" + OPTIONS="${OPTIONS} ${VIRTUAL_DEVICE}" + fi +} + +start() { + checkconfig || return 1 + + ebegin "Starting CAPI4HylaFAX for ${VIRTUAL_DEVICE}" + start-stop-daemon -b -m --quiet --start --pidfile ${PIDFILE} \ + --exec /usr/bin/c2faxrecv -- ${OPTIONS} + eend $? +} + +stop() { + checkconfig || return 1 + + ebegin "Stopping CAPI4HylaFAX for ${VIRTUAL_DEVICE}" + start-stop-daemon >/dev/null --quiet --stop --pidfile ${PIDFILE} --retry 10 && \ + /bin/rm -f ${PIDFILE} + eend $? +} + |