Skip to content

Commit 22322f5

Browse files
committed
auto formatting, no change in logic
1 parent a332be6 commit 22322f5

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

setup/start.sh

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ source setup/preflight.sh
1414
# Python may not be able to read/write files. This is also
1515
# in the management daemon startup script and the cron script.
1616

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
2020
fi
2121

2222
export LANGUAGE=en_US.UTF-8
@@ -35,7 +35,7 @@ if [ -f /etc/mailinabox.conf ]; then
3535

3636
# Load the old .conf file to get existing configuration options loaded
3737
# 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
3939
source /tmp/mailinabox.prev.conf
4040
rm -f /tmp/mailinabox.prev.conf
4141
else
@@ -44,7 +44,7 @@ fi
4444

4545
# Put a start script in a global location. We tell the user to run 'mailinabox'
4646
# 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
4848
#!/bin/bash
4949
cd $PWD
5050
source setup/start.sh
@@ -61,9 +61,9 @@ source setup/questions.sh
6161
# Skip on existing installs since we don't want this to block the ability to
6262
# upgrade, and these checks are also in the control panel status checks.
6363
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
6767
fi
6868

6969
# Create the STORAGE_USER and STORAGE_ROOT directory if they don't already exist.
@@ -82,17 +82,20 @@ if [ ! -d "$STORAGE_ROOT" ]; then
8282
mkdir -p "$STORAGE_ROOT"
8383
fi
8484
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
8689
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"
8891
chown "$STORAGE_USER:$STORAGE_USER" "$STORAGE_ROOT/mailinabox.version"
8992
fi
9093

9194
# Save the global options in /etc/mailinabox.conf so that standalone
9295
# tools know where to look for data. The default MTA_STS_MODE setting
9396
# is blank unless set by an environment variable, but see web.sh for
9497
# how that is interpreted.
95-
cat > /etc/mailinabox.conf << EOF;
98+
cat >/etc/mailinabox.conf <<EOF
9699
STORAGE_USER=$STORAGE_USER
97100
STORAGE_ROOT=$STORAGE_ROOT
98101
PRIMARY_HOSTNAME=$PRIMARY_HOSTNAME
@@ -120,8 +123,7 @@ source setup/management.sh
120123
source setup/munin.sh
121124

122125
# 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
125127
echo "Waiting for the Mail-in-a-Box management daemon to start..."
126128
sleep 2
127129
done
@@ -143,13 +145,13 @@ source setup/firstuser.sh
143145
# run in the recommended curl-pipe-to-bash method there is no TTY and
144146
# certbot will fail if it tries to ask.
145147
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"
153155
fi
154156

155157
# Done.
@@ -166,16 +168,14 @@ if management/status_checks.py --check-primary-hostname; then
166168
echo
167169
echo "If you have a DNS problem put the box's IP address in the URL"
168170
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"
171172
else
172173
echo "https://$PUBLIC_IP/admin"
173174
echo
174175
echo "You will be alerted that the website has an invalid certificate. Check that"
175176
echo "the certificate fingerprint matches:"
176177
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"
179179
echo
180180
echo "Then you can confirm the security exception and continue."
181181
echo

0 commit comments

Comments
 (0)