You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-dns/pdnsd/files/pdnsd.online.2

34 lines
568 B

#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command="/usr/sbin/pdnsd-ctl"
depend() {
need pdnsd
}
wait_for_socket() {
local i=0 pdnsd_socket="/var/cache/pdnsd/pdnsd.status"
while [ ${i} -lt 10 ]; do
[ -S "${pdnsd_socket}" ] && return 0
i=$((${i}+1))
sleep 1
done
return 1
}
start() {
wait_for_socket || return 1
ebegin "Starting pdnsd-online"
${command} -q server all up
eend $?
}
stop() {
ebegin "Stopping pdnsd-online"
${command} -q server all down
eend $?
}