#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-proxy/middleman/files/init.d/mman,v 1.1 2005/04/22 19:15:11 mrness Exp $ opts="depend checkconfig stop start" depend() { need net } checkconfig() { if [ ! -e /etc/mman/config.xml ]; then eerror "You need to create a /etc/mman/config.xml first." return 1 fi } stop() { ebegin "Stopping mman" start-stop-daemon --stop --quiet --pidfile /var/run/mman.pid result=$? eend $result } start() { local myopts="-p /var/run/mman.pid" [ "${CONFIG}" != "" ] && myopts="${myopts} -c ${CONFIG}" [ "${LOGFILE}" != "" ] && myopts="${myopts} -l ${LOGFILE}" [ "${LOGLEVEL}" != "" ] && myopts="${myopts} -d ${LOGLEVEL}" [ "${SECTION}" != "" ] && myopts="${myopts} -s ${SECTION}" ebegin "Starting mman" start-stop-daemon --start --quiet --exec /usr/bin/mman -- ${myopts} result=$? eend $result }