@@ -14,9 +14,9 @@ source setup/preflight.sh
14
14
# Python may not be able to read/write files. This is also
15
15
# in the management daemon startup script and the cron script.
16
16
17
- if ! locale -a | grep en_US.utf8 > /dev/null; then
18
- # Generate locale if not exists
19
- hide_output locale-gen en_US.UTF-8
17
+ if ! locale -a | grep en_US.utf8 > /dev/null; then
18
+ # Generate locale if not exists
19
+ hide_output locale-gen en_US.UTF-8
20
20
fi
21
21
22
22
export LANGUAGE=en_US.UTF-8
@@ -35,7 +35,7 @@ if [ -f /etc/mailinabox.conf ]; then
35
35
36
36
# Load the old .conf file to get existing configuration options loaded
37
37
# into variables with a DEFAULT_ prefix.
38
- cat /etc/mailinabox.conf | sed s/^/DEFAULT_/ > /tmp/mailinabox.prev.conf
38
+ cat /etc/mailinabox.conf | sed s/^/DEFAULT_/ > /tmp/mailinabox.prev.conf
39
39
source /tmp/mailinabox.prev.conf
40
40
rm -f /tmp/mailinabox.prev.conf
41
41
else
44
44
45
45
# Put a start script in a global location. We tell the user to run 'mailinabox'
46
46
# in the first dialog prompt, so we should do this before that starts.
47
- cat > /usr/local/bin/mailinabox << EOF ;
47
+ cat > /usr/local/bin/mailinabox << EOF
48
48
#!/bin/bash
49
49
cd $PWD
50
50
source setup/start.sh
@@ -61,9 +61,9 @@ source setup/questions.sh
61
61
# Skip on existing installs since we don't want this to block the ability to
62
62
# upgrade, and these checks are also in the control panel status checks.
63
63
if [ -z " ${DEFAULT_PRIMARY_HOSTNAME:- } " ]; then
64
- if [ -z " ${SKIP_NETWORK_CHECKS:- } " ]; then
65
- source setup/network-checks.sh
66
- fi
64
+ if [ -z " ${SKIP_NETWORK_CHECKS:- } " ]; then
65
+ source setup/network-checks.sh
66
+ fi
67
67
fi
68
68
69
69
# Create the STORAGE_USER and STORAGE_ROOT directory if they don't already exist.
@@ -82,17 +82,20 @@ if [ ! -d "$STORAGE_ROOT" ]; then
82
82
mkdir -p " $STORAGE_ROOT "
83
83
fi
84
84
f=$STORAGE_ROOT
85
- while [[ $f != / ]]; do chmod a+rx " $f " ; f=$( dirname " $f " ) ; done ;
85
+ while [[ $f != / ]]; do
86
+ chmod a+rx " $f "
87
+ f=$( dirname " $f " )
88
+ done
86
89
if [ ! -f " $STORAGE_ROOT /mailinabox.version" ]; then
87
- setup/migrate.py --current > " $STORAGE_ROOT /mailinabox.version"
90
+ setup/migrate.py --current > " $STORAGE_ROOT /mailinabox.version"
88
91
chown " $STORAGE_USER :$STORAGE_USER " " $STORAGE_ROOT /mailinabox.version"
89
92
fi
90
93
91
94
# Save the global options in /etc/mailinabox.conf so that standalone
92
95
# tools know where to look for data. The default MTA_STS_MODE setting
93
96
# is blank unless set by an environment variable, but see web.sh for
94
97
# how that is interpreted.
95
- cat > /etc/mailinabox.conf << EOF ;
98
+ cat > /etc/mailinabox.conf << EOF
96
99
STORAGE_USER=$STORAGE_USER
97
100
STORAGE_ROOT=$STORAGE_ROOT
98
101
PRIMARY_HOSTNAME=$PRIMARY_HOSTNAME
@@ -120,8 +123,7 @@ source setup/management.sh
120
123
source setup/munin.sh
121
124
122
125
# Wait for the management daemon to start...
123
- until nc -z -w 4 127.0.0.1 10222
124
- do
126
+ until nc -z -w 4 127.0.0.1 10222; do
125
127
echo " Waiting for the Mail-in-a-Box management daemon to start..."
126
128
sleep 2
127
129
done
@@ -143,13 +145,13 @@ source setup/firstuser.sh
143
145
# run in the recommended curl-pipe-to-bash method there is no TTY and
144
146
# certbot will fail if it tries to ask.
145
147
if [ ! -d " $STORAGE_ROOT /ssl/lets_encrypt/accounts/acme-v02.api.letsencrypt.org/" ]; then
146
- echo
147
- echo " -----------------------------------------------"
148
- echo " Mail-in-a-Box uses Let's Encrypt to provision free SSL/TLS certificates"
149
- echo " to enable HTTPS connections to your box. We're automatically"
150
- echo " agreeing you to their subscriber agreement. See https://letsencrypt.org."
151
- echo
152
- certbot register --register-unsafely-without-email --agree-tos --config-dir " $STORAGE_ROOT /ssl/lets_encrypt"
148
+ echo
149
+ echo " -----------------------------------------------"
150
+ echo " Mail-in-a-Box uses Let's Encrypt to provision free SSL/TLS certificates"
151
+ echo " to enable HTTPS connections to your box. We're automatically"
152
+ echo " agreeing you to their subscriber agreement. See https://letsencrypt.org."
153
+ echo
154
+ certbot register --register-unsafely-without-email --agree-tos --config-dir " $STORAGE_ROOT /ssl/lets_encrypt"
153
155
fi
154
156
155
157
# Done.
@@ -166,16 +168,14 @@ if management/status_checks.py --check-primary-hostname; then
166
168
echo
167
169
echo " If you have a DNS problem put the box's IP address in the URL"
168
170
echo " (https://$PUBLIC_IP /admin) but then check the TLS fingerprint:"
169
- openssl x509 -in " $STORAGE_ROOT /ssl/ssl_certificate.pem" -noout -fingerprint -sha256\
170
- | sed " s/SHA256 Fingerprint=//i"
171
+ openssl x509 -in " $STORAGE_ROOT /ssl/ssl_certificate.pem" -noout -fingerprint -sha256 | sed " s/SHA256 Fingerprint=//i"
171
172
else
172
173
echo " https://$PUBLIC_IP /admin"
173
174
echo
174
175
echo " You will be alerted that the website has an invalid certificate. Check that"
175
176
echo " the certificate fingerprint matches:"
176
177
echo
177
- openssl x509 -in " $STORAGE_ROOT /ssl/ssl_certificate.pem" -noout -fingerprint -sha256\
178
- | sed " s/SHA256 Fingerprint=//i"
178
+ openssl x509 -in " $STORAGE_ROOT /ssl/ssl_certificate.pem" -noout -fingerprint -sha256 | sed " s/SHA256 Fingerprint=//i"
179
179
echo
180
180
echo " Then you can confirm the security exception and continue."
181
181
echo
0 commit comments