[arch-commits] Commit in dnsmasq/trunk (PKGBUILD rc.dnsmasq)

Dave Reisner dreisner at archlinux.org
Wed Oct 19 12:18:49 EDT 2011


    Date: Wednesday, October 19, 2011 @ 12:18:48
  Author: dreisner
Revision: 140806

upgpkg: dnsmasq 2.59-2

- avoid 'syntax check: OK' output on startup. only show results of syntax
  check if it fails.

Modified:
  dnsmasq/trunk/PKGBUILD
  dnsmasq/trunk/rc.dnsmasq

------------+
 PKGBUILD   |    2 +-
 rc.dnsmasq |   13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-10-19 16:10:30 UTC (rev 140805)
+++ PKGBUILD	2011-10-19 16:18:48 UTC (rev 140806)
@@ -5,7 +5,7 @@
 
 pkgname=dnsmasq
 pkgver=2.59
-pkgrel=1
+pkgrel=2
 pkgdesc="Lightweight, easy to configure DNS forwarder and DHCP server"
 url="http://www.thekelleys.org.uk/dnsmasq/doc.html"
 arch=('i686' 'x86_64')

Modified: rc.dnsmasq
===================================================================
--- rc.dnsmasq	2011-10-19 16:10:30 UTC (rev 140805)
+++ rc.dnsmasq	2011-10-19 16:18:48 UTC (rev 140806)
@@ -4,6 +4,17 @@
 . /etc/rc.d/functions
 . /etc/conf.d/dnsmasq
 
+checkconfig() {
+  local testout
+
+  if ! testout=$(/usr/sbin/dnsmasq --test 2>&1); then
+    echo "$testout"
+    return 1
+  fi
+
+  return 0
+}
+
 pidfile=/run/dnsmasq.pid
 if [[ -r $pidfile ]]; then
   read -r PID < "$pidfile"
@@ -17,7 +28,7 @@
 case $1 in
   start)
     stat_busy "Starting DNS/DHCP daemon"
-    if [[ -z $PID ]] && /usr/sbin/dnsmasq --test &&
+    if [[ -z $PID ]] && checkconfig &&
         /usr/sbin/dnsmasq "--user=${DNSMASQ_USER:-nobody}" \
                           "--pid-file=$pidfile" \
                           "${DNSMASQ_OPTS[@]}"; then



More information about the arch-commits mailing list