--- a/bin/update Thu Dec 19 21:04:07 2013 +0200
+++ b/bin/update Thu Dec 19 22:00:37 2013 +0200
@@ -1,8 +1,7 @@
#!/bin/bash
# vim: set ft=sh :
-set -ue
-
+# Bootstrap
if [ $0 == './update' ]; then
SRV=$(pwd)
OPT=./opt
@@ -12,34 +11,8 @@
cd $SRV
fi
-# charset for files under etc/
-CHARSET='utf-8'
-
-# External bins
-NAMED_CHECKZONE=/usr/sbin/named-checkzone
-
-DHCPD=/usr/sbin/dhcpd
-DHCPD_CONF=/etc/dhcp/dhcpd.conf
-DHCPD_INIT=/etc/init.d/isc-dhcp-server
-
-HG=/usr/bin/hg
-HG_ARGS=(--config trusted.users=root)
-
-RNDC=/usr/sbin/rndc
-RNDC_KEY=/etc/bind/rndc.key
-
-# Library includes
source lib/update
-## Flags
-# set by do_reload_zone if zone data has actually been reloaded
-RELOAD_ZONES=
-
-## Site settings, used as arguments to scripts
-# Origin domain to generate reverse records for in --reverse-zone
-REVERSE_DOMAIN=paivola.fi
-
-## Do things
function update {
log "Testing hosts..."
for hosts in $(list_files etc/hosts); do
@@ -86,7 +59,9 @@
for conf in $(list_files etc/dhcp); do
update_dhcp_conf "var/dhcp/$conf" "etc/dhcp/$conf"
done
-
+}
+
+function deploy {
## Check
log "Testing zones..."
for zone in $(list_files etc/zones); do
@@ -98,7 +73,6 @@
check_dhcp $conf
done
- ## Deploy
log "Reload zones..."
reload_zones
@@ -135,6 +109,7 @@
## Go
update
+ deploy
}
main "$@"