diff --git a/setup/dkim.sh b/setup/dkim.sh index d2d162a7..d99c78a7 100755 --- a/setup/dkim.sh +++ b/setup/dkim.sh @@ -6,7 +6,7 @@ # # The DNS configuration for DKIM is done in the management daemon. -source setup/functions.sh # load our functions +source setup/functions.sh # load our functions source /etc/mailinabox.conf # load global vars # Install DKIM... @@ -14,12 +14,12 @@ echo Installing OpenDKIM/OpenDMARC... apt_install opendkim opendkim-tools opendmarc # Make sure configuration directories exist. -mkdir -p /etc/opendkim; +mkdir -p /etc/opendkim mkdir -p $STORAGE_ROOT/mail/dkim # Used in InternalHosts and ExternalIgnoreList configuration directives. # Not quite sure why. -echo "127.0.0.1" > /etc/opendkim/TrustedHosts +echo "127.0.0.1" >/etc/opendkim/TrustedHosts # We need to at least create these files, since we reference them later. # Otherwise, opendkim startup will fail @@ -30,7 +30,7 @@ if grep -q "ExternalIgnoreList" /etc/opendkim.conf; then true # already done #NODOC else # Add various configuration options to the end of `opendkim.conf`. - cat >> /etc/opendkim.conf << EOF; + cat >>/etc/opendkim.conf < /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 <