bin/update
changeset 66 482d06935d96
parent 64 620f4594a09d
child 69 88a7683efc54
equal deleted inserted replaced
65:21b33b9090d0 66:482d06935d96
    36 DHCP_DATA=$DATA/dhcp
    36 DHCP_DATA=$DATA/dhcp
    37 
    37 
    38 # global DHCP conf to test
    38 # global DHCP conf to test
    39 DHCPD=/usr/sbin/dhcpd
    39 DHCPD=/usr/sbin/dhcpd
    40 DHCPD_CONF=/etc/dhcp/dhcpd.conf
    40 DHCPD_CONF=/etc/dhcp/dhcpd.conf
       
    41 DHCPD_INIT=/etc/init.d/isc-dhcp-server
    41 
    42 
    42 # hg repo to commit
    43 # hg repo to commit
    43 REPO=$DATA
    44 REPO=$DATA
    44 
    45 
    45 ## Settings used in lib
    46 ## Settings used in lib
    46 # Hide files under repo in commit diff output..
    47 # Hide files under repo in commit diff output..
    47 REPO_HIDE='*.serial'
    48 REPO_HIDE='*.serial'
    48 
    49 
    49 # XXX: hosts data input charset?
    50 # XXX: hosts data input charset?
    50 PROCESS_ARGS='--input-charset latin-1'
    51 PROCESS_ARGS='--input-charset latin-1'
       
    52 DHCP_FILE_ARGS='--input-charset latin-1'
    51 
    53 
    52 # External bins
    54 # External bins
    53 NAMED_CHECKZONE=/usr/sbin/named-checkzone
    55 NAMED_CHECKZONE=/usr/sbin/named-checkzone
    54 
    56 
    55 HG=/usr/bin/hg
    57 HG=/usr/bin/hg
    74 source $LIB/update.updates
    76 source $LIB/update.updates
    75 
    77 
    76 # Operations; the functions called from run()
    78 # Operations; the functions called from run()
    77 source $LIB/update.operations
    79 source $LIB/update.operations
    78 
    80 
       
    81 ## Flags
       
    82 # set by do_reload_zone if zone data has actually been reloaded
       
    83 RELOAD_ZONES=
    79 
    84 
    80 ## Site settings, used as arguments to scripts
    85 ## Site settings, used as arguments to scripts
    81 # MX record to generate in hosts --forward-zone
    86 # MX record to generate in hosts --forward-zone
    82 FORWARD_MX=mail
    87 FORWARD_MX=mail
    83 
    88 
   200     log "Testing dhcp..."
   205     log "Testing dhcp..."
   201         # this is partially redundant with the above check_dhcp_hosts, but doesn't matter
   206         # this is partially redundant with the above check_dhcp_hosts, but doesn't matter
   202         check_dhcp
   207         check_dhcp
   203 }
   208 }
   204 
   209 
       
   210 # Runs DHCP checks, once DNS hosts have been updated
       
   211 function run_dhcp_check {
       
   212     log "Testing dhcp hosts..."
       
   213         for conf in "${DHCP_CONFS[@]}"; do
       
   214             check_dhcp_hosts    $DHCP/$conf.conf
       
   215         done
       
   216 }
       
   217 
   205 function run_deploy {
   218 function run_deploy {
   206     ## Reload zones
   219     ## Reload zones
   207     log "Reload zones..."
   220     log "Reload zones..."
   208         reload_zones
   221         reload_zones
       
   222 
       
   223     ## DHCP
       
   224     run_dhcp_check
       
   225 
       
   226     log "Reload dhcp..."
       
   227         reload_dhcp
   209 
   228 
   210     ## Commit
   229     ## Commit
   211     log "Commit data..."
   230     log "Commit data..."
   212         commit_data
   231         commit_data
   213 }
   232 }