#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-dns/pdnsd/files/pdnsd.online,v 1.6 2008/12/13 10:53:29 mrness Exp $ depend() { need pdnsd net.${IFACE} } wait_for_socket() { local i pdnsd_socket="/var/cache/pdnsd/pdnsd.status" for ((i=0; i < 10; i=$i+1)) ; do [ -S "${pdnsd_socket}" ] && return 0 sleep 1s done eerror "${pdnsd_socket} socket is missing." return 1 } start() { wait_for_socket || return 1 ebegin "Starting pdnsd-online" /usr/sbin/pdnsd-ctl -q server all up eend $? } stop() { ebegin "Stopping pdnsd-online" /usr/sbin/pdnsd-ctl -q server all down eend $? }