diff --git a/management/dns_update.py b/management/dns_update.py index 9a768ea85..4bdc732f1 100755 --- a/management/dns_update.py +++ b/management/dns_update.py @@ -501,19 +501,19 @@ def write_nsd_zone(domain, zonefile, records, env, force): zone = """ $ORIGIN {domain}. -$TTL 86400 ; default time to live +$TTL {ttl} ; default time to live @ IN SOA ns1.{primary_domain}. hostmaster.{primary_domain}. ( __SERIAL__ ; serial number 7200 ; Refresh (secondary nameserver update interval) 3600 ; Retry (when refresh fails, how often to try again, should be lower than the refresh) 1209600 ; Expire (when refresh fails, how long secondary nameserver will keep records around anyway) - 86400 ; Negative TTL (how long negative responses are cached) + {ttl} ; Negative TTL (how long negative responses are cached) ) """ # Replace replacement strings. - zone = zone.format(domain=domain, primary_domain=env["PRIMARY_HOSTNAME"]) + zone = zone.format(domain=domain, primary_domain=env["PRIMARY_HOSTNAME"], ttl=env["TTL"]) # Add records. for subdomain, querytype, value, explanation in records: diff --git a/setup/start.sh b/setup/start.sh index 3abb4fe30..317d58952 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -14,9 +14,9 @@ source setup/preflight.sh # Python may not be able to read/write files. This is also # in the management daemon startup script and the cron script. -if ! locale -a | grep en_US.utf8 > /dev/null; then - # Generate locale if not exists - hide_output locale-gen en_US.UTF-8 +if ! locale -a | grep en_US.utf8 >/dev/null; then + # Generate locale if not exists + hide_output locale-gen en_US.UTF-8 fi export LANGUAGE=en_US.UTF-8 @@ -35,7 +35,7 @@ if [ -f /etc/mailinabox.conf ]; then # Load the old .conf file to get existing configuration options loaded # into variables with a DEFAULT_ prefix. - cat /etc/mailinabox.conf | sed s/^/DEFAULT_/ > /tmp/mailinabox.prev.conf + cat /etc/mailinabox.conf | sed s/^/DEFAULT_/ >/tmp/mailinabox.prev.conf source /tmp/mailinabox.prev.conf rm -f /tmp/mailinabox.prev.conf else @@ -44,7 +44,7 @@ fi # Put a start script in a global location. We tell the user to run 'mailinabox' # in the first dialog prompt, so we should do this before that starts. -cat > /usr/local/bin/mailinabox << EOF; +cat >/usr/local/bin/mailinabox < $STORAGE_ROOT/mailinabox.version + setup/migrate.py --current >$STORAGE_ROOT/mailinabox.version chown $STORAGE_USER:$STORAGE_USER $STORAGE_ROOT/mailinabox.version fi @@ -92,7 +95,7 @@ fi # tools know where to look for data. The default MTA_STS_MODE setting # is blank unless set by an environment variable, but see web.sh for # how that is interpreted. -cat > /etc/mailinabox.conf << EOF; +cat >/etc/mailinabox.conf <