register_hook setup_base_hooks setup_network
+setup_base_cluster_setup_config ()
+{
+ local f
+ {
+ echo "# Generated by autocluster"
+ echo
+ # This is a bit of a hack. Perhaps these script belong
+ # elsewhere, since they no longer have templates?
+ for f in $(find "${BASE_TEMPLATES}/all/root/scripts" -type f |
+ xargs grep -l '^#config:') ; do
+
+ b=$(basename "$f")
+ echo "# $b"
+ local vs v
+ vs=$(sed -n 's@^#config: *@@p' "$f")
+ for v in $vs ; do
+ # This could substitute the values in directly using
+ # ${!v} but then no sanity checking is done to make
+ # sure variables are set.
+ echo "${v}=\"@@${v}@@\""
+ done
+ echo
+ done
+ } | diskimage substitute_vars - "/root/scripts/cluster_setup.config"
+}
+
+register_hook setup_base_hooks setup_base_cluster_setup_config
+
setup_timezone() {
[ -z "$TIMEZONE" ] && {
[ -r /etc/timezone ] && {