bin/update
changeset 66 482d06935d96
parent 64 620f4594a09d
child 69 88a7683efc54
--- a/bin/update	Wed Mar 21 18:43:56 2012 +0200
+++ b/bin/update	Wed Mar 21 18:59:43 2012 +0200
@@ -38,6 +38,7 @@
 # global DHCP conf to test
 DHCPD=/usr/sbin/dhcpd
 DHCPD_CONF=/etc/dhcp/dhcpd.conf
+DHCPD_INIT=/etc/init.d/isc-dhcp-server
 
 # hg repo to commit
 REPO=$DATA
@@ -48,6 +49,7 @@
 
 # XXX: hosts data input charset?
 PROCESS_ARGS='--input-charset latin-1'
+DHCP_FILE_ARGS='--input-charset latin-1'
 
 # External bins
 NAMED_CHECKZONE=/usr/sbin/named-checkzone
@@ -76,6 +78,9 @@
 # Operations; the functions called from run()
 source $LIB/update.operations
 
+## Flags
+# set by do_reload_zone if zone data has actually been reloaded
+RELOAD_ZONES=
 
 ## Site settings, used as arguments to scripts
 # MX record to generate in hosts --forward-zone
@@ -202,11 +207,25 @@
         check_dhcp
 }
 
+# Runs DHCP checks, once DNS hosts have been updated
+function run_dhcp_check {
+    log "Testing dhcp hosts..."
+        for conf in "${DHCP_CONFS[@]}"; do
+            check_dhcp_hosts    $DHCP/$conf.conf
+        done
+}
+
 function run_deploy {
     ## Reload zones
     log "Reload zones..."
         reload_zones
 
+    ## DHCP
+    run_dhcp_check
+
+    log "Reload dhcp..."
+        reload_dhcp
+
     ## Commit
     log "Commit data..."
         commit_data