summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hendrikx (whyscream) <tom@whyscream.net>2010-08-02 19:26:56 +0000
committerTom Hendrikx (whyscream) <tom@whyscream.net>2010-08-02 19:26:56 +0000
commit2e0d2b7a82544344fcca21dbfc962d903377dc6c (patch)
treea4f93d2ce58399f2cd042cebbe436f31f1a58098 /net-dns/nsd/files/nsd.initd
parentmail-mta/citadel: Yet another version bump, upstream maintanance and bug fix ... (diff)
downloadsunrise-2e0d2b7a82544344fcca21dbfc962d903377dc6c.tar.gz
sunrise-2e0d2b7a82544344fcca21dbfc962d903377dc6c.tar.bz2
sunrise-2e0d2b7a82544344fcca21dbfc962d903377dc6c.zip
version bump to nsd 3.2.6, dropping 3 USE flags due to upstream 'cleanup' in configure script, minor update to init script
svn path=/sunrise/; revision=11070
Diffstat (limited to 'net-dns/nsd/files/nsd.initd')
-rw-r--r--net-dns/nsd/files/nsd.initd16
1 files changed, 13 insertions, 3 deletions
diff --git a/net-dns/nsd/files/nsd.initd b/net-dns/nsd/files/nsd.initd
index a2ad26a73..76ac12100 100644
--- a/net-dns/nsd/files/nsd.initd
+++ b/net-dns/nsd/files/nsd.initd
@@ -1,5 +1,5 @@
#!/sbin/runscript
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
@@ -20,7 +20,7 @@ depend() {
}
_checkconf() {
- if [ ! -e "${config_file}" ]; then
+ if ! test -e "${config_file}"; then
eerror "You need to create an appropriate config file."
eerror "An example can be found in /etc/nsd/nsd.conf.sample"
return 1
@@ -33,8 +33,17 @@ _checkconf() {
return 0
}
+_checkdb() {
+ local database=$(${my_nsd_checkconf} -o database ${config_file})
+ if ! test -f $database; then
+ eerror "You have no database file in ${database}, will try to rebuild"
+ _rebuild
+ fi
+ return 0
+}
+
_patch() {
- local difffile=`${my_nsd_checkconf} -o difffile ${config_file}`
+ local difffile=$(${my_nsd_checkconf} -o difffile ${config_file})
if test -s ${difffile}; then
ebegin "Patching NSD zone files"
${my_nsdc} patch > /dev/null
@@ -53,6 +62,7 @@ _rebuild() {
start() {
ebegin "Starting NSD"
_checkconf || return 1
+ _checkdb || _rebuild || return 1
${my_nsdc} start
${my_nsdc} running
eend $?