#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-misc/ptrtd/files/ptrtd.initd,v 1.2 2004/07/15 00:09:37 agriffis Exp $ # Init script for the ptrtd daemon. # # Peter Johanson depends() { need net } checkconfig() { if [ -z ${IPV6_PREFIX} ]; then eerror "You must define IPV6_PREFIX in /etc/conf.d/ptrtd" return 1 fi if [[ -n ${DRIVER} && -z ${INTERFACE} ]]; then eerror "You must define INTERFACE along with DRIVER in" \ "/etc/conf.d/ptrtd" return 1 fi return 0 } start() { checkconfig || return 1 ebegin "Starting ptrtd" start-stop-daemon --start --quiet --exec /usr/sbin/ptrtd \ -- ${INTERFACE:+-i} "$DRIVER"${DRIVER:+:}"$INTERFACE" \ -p ${IPV6_PREFIX} \ ${PREFIX_LEN:+-l} "${PREFIX_LEN}" &> /dev/null eend $? } stop() { ebegin "Stopping ptrtd" start-stop-daemon --stop --quiet --exec /usr/sbin/ptrtd eend $? }