Browse Source

sanitycheck: add named-checkconf; update interface verification

guillaume 8 years ago
parent
commit
91e3bf7e9f
1 changed files with 12 additions and 4 deletions
  1. 12 4
      src/sanitycheck

+ 12 - 4
src/sanitycheck

@@ -2,10 +2,13 @@
 
 
 LOGGER="logger -t sanitycheck -s"
 LOGGER="logger -t sanitycheck -s"
 
 
-for iface in $(ifquery --list)
-do
-  ifup --no-act "$iface" 2> /dev/null || echo "Error: interface $iface has configuration issue(s)" | $LOGGER
-done
+# ifup: verify interface configuration
+if type "ifquery" > /dev/null; then
+  for iface in $(ifquery --list)
+  do
+    ifup --no-act "$iface" 2> /dev/null || echo "Error: interface $iface has configuration issue(s)" | $LOGGER
+  done
+fi
 
 
 # mount: fake-mount filesystems to detect /etc/fstab errors
 # mount: fake-mount filesystems to detect /etc/fstab errors
 if type "mount" > /dev/null; then
 if type "mount" > /dev/null; then
@@ -27,6 +30,11 @@ if type "postfix" > /dev/null; then
   postfix check 2>&1 | $LOGGER
   postfix check 2>&1 | $LOGGER
 fi
 fi
 
 
+# named-checkconf (bind)
+if type "named-checkconf" > /dev/null; then
+  named-checkconf 2>&1 | $LOGGER
+fi
+
 # nginx: verify configuration syntax
 # nginx: verify configuration syntax
 if type "nginx" > /dev/null; then
 if type "nginx" > /dev/null; then
   nginx -t -q 2>&1 | $LOGGER
   nginx -t -q 2>&1 | $LOGGER