1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-12-22 07:17:05 +00:00

Quote echo commands to preserve whitespace.

This commit is contained in:
Teal Dulcet 2023-12-21 08:44:22 -08:00 committed by Joshua Tauberer
parent 55a8be4aa9
commit ec497efa69
8 changed files with 23 additions and 23 deletions

View File

@ -53,7 +53,7 @@ fi
# Clone the Mail-in-a-Box repository if it doesn't exist. # Clone the Mail-in-a-Box repository if it doesn't exist.
if [ ! -d "$HOME/mailinabox" ]; then if [ ! -d "$HOME/mailinabox" ]; then
if [ ! -f /usr/bin/git ]; then if [ ! -f /usr/bin/git ]; then
echo Installing git . . . echo "Installing git . . ."
apt-get -q -q update apt-get -q -q update
DEBIAN_FRONTEND=noninteractive apt-get -q -q install -y git < /dev/null DEBIAN_FRONTEND=noninteractive apt-get -q -q install -y git < /dev/null
echo echo

View File

@ -10,7 +10,7 @@ source setup/functions.sh # load our functions
source /etc/mailinabox.conf # load global vars source /etc/mailinabox.conf # load global vars
# Install DKIM... # Install DKIM...
echo Installing OpenDKIM/OpenDMARC... echo "Installing OpenDKIM/OpenDMARC..."
apt_install opendkim opendkim-tools opendmarc apt_install opendkim opendkim-tools opendmarc
# Make sure configuration directories exist. # Make sure configuration directories exist.

View File

@ -25,7 +25,7 @@ function hide_output {
if [ $E != 0 ]; then if [ $E != 0 ]; then
# Something failed. # Something failed.
echo echo
echo FAILED: "$@" echo "FAILED: $*"
echo ----------------------------------------- echo -----------------------------------------
cat "$OUTPUT" cat "$OUTPUT"
echo ----------------------------------------- echo -----------------------------------------

View File

@ -8,7 +8,7 @@ if [ -z "${NONINTERACTIVE:-}" ]; then
# #
# Also install dependencies needed to validate the email address. # Also install dependencies needed to validate the email address.
if [ ! -f /usr/bin/dialog ] || [ ! -f /usr/bin/python3 ] || [ ! -f /usr/bin/pip3 ]; then if [ ! -f /usr/bin/dialog ] || [ ! -f /usr/bin/python3 ] || [ ! -f /usr/bin/pip3 ]; then
echo Installing packages needed for setup... echo "Installing packages needed for setup..."
apt-get -q -q update apt-get -q -q update
apt_get_quiet install dialog python3 python3-pip || exit 1 apt_get_quiet install dialog python3 python3-pip || exit 1
fi fi

View File

@ -122,7 +122,7 @@ source setup/munin.sh
# Wait for the management daemon to start... # Wait for the management daemon to start...
until nc -z -w 4 127.0.0.1 10222 until nc -z -w 4 127.0.0.1 10222
do do
echo Waiting for the Mail-in-a-Box management daemon to start... echo "Waiting for the Mail-in-a-Box management daemon to start..."
sleep 2 sleep 2
done done
@ -156,9 +156,9 @@ fi
echo echo
echo "-----------------------------------------------" echo "-----------------------------------------------"
echo echo
echo Your Mail-in-a-Box is running. echo "Your Mail-in-a-Box is running."
echo echo
echo Please log in to the control panel for further instructions at: echo "Please log in to the control panel for further instructions at:"
echo echo
if management/status_checks.py --check-primary-hostname; then if management/status_checks.py --check-primary-hostname; then
# Show the nice URL if it appears to be resolving and has a valid certificate. # Show the nice URL if it appears to be resolving and has a valid certificate.
@ -171,12 +171,12 @@ if management/status_checks.py --check-primary-hostname; then
else else
echo "https://$PUBLIC_IP/admin" echo "https://$PUBLIC_IP/admin"
echo echo
echo You will be alerted that the website has an invalid certificate. Check that echo "You will be alerted that the website has an invalid certificate. Check that"
echo the certificate fingerprint matches: echo "the certificate fingerprint matches:"
echo echo
openssl x509 -in "$STORAGE_ROOT/ssl/ssl_certificate.pem" -noout -fingerprint -sha256\ openssl x509 -in "$STORAGE_ROOT/ssl/ssl_certificate.pem" -noout -fingerprint -sha256\
| sed "s/SHA256 Fingerprint=//i" | sed "s/SHA256 Fingerprint=//i"
echo echo
echo Then you can confirm the security exception and continue. echo "Then you can confirm the security exception and continue."
echo echo
fi fi

View File

@ -111,7 +111,7 @@ hide_output add-apt-repository --y ppa:ondrej/php
# of things from Ubuntu, as well as the directory of packages provide by the # of things from Ubuntu, as well as the directory of packages provide by the
# PPAs so we can install those packages later. # PPAs so we can install those packages later.
echo Updating system packages... echo "Updating system packages..."
hide_output apt-get update hide_output apt-get update
apt_get_quiet upgrade apt_get_quiet upgrade
@ -136,7 +136,7 @@ apt_get_quiet autoremove
# * bc: allows us to do math to compute sane defaults # * bc: allows us to do math to compute sane defaults
# * openssh-client: provides ssh-keygen # * openssh-client: provides ssh-keygen
echo Installing system packages... echo "Installing system packages..."
apt_install python3 python3-dev python3-pip python3-setuptools \ apt_install python3 python3-dev python3-pip python3-setuptools \
netcat-openbsd wget curl git sudo coreutils bc file \ netcat-openbsd wget curl git sudo coreutils bc file \
pollinate openssh-client unzip \ pollinate openssh-client unzip \
@ -227,7 +227,7 @@ fi
# hardware entropy to get going, by drawing from /dev/random. haveged makes this # hardware entropy to get going, by drawing from /dev/random. haveged makes this
# less likely to stall for very long. # less likely to stall for very long.
echo Initializing system random number generator... echo "Initializing system random number generator..."
dd if=/dev/random of=/dev/urandom bs=1 count=32 2> /dev/null dd if=/dev/random of=/dev/urandom bs=1 count=32 2> /dev/null
# This is supposedly sufficient. But because we're not sure if hardware entropy # This is supposedly sufficient. But because we're not sure if hardware entropy
@ -274,7 +274,7 @@ if [ -z "${DISABLE_FIREWALL:-}" ]; then
if [ -n "$SSH_PORT" ]; then if [ -n "$SSH_PORT" ]; then
if [ "$SSH_PORT" != "22" ]; then if [ "$SSH_PORT" != "22" ]; then
echo Opening alternate SSH port "$SSH_PORT". #NODOC echo "Opening alternate SSH port $SSH_PORT." #NODOC
ufw_limit "$SSH_PORT" #NODOC ufw_limit "$SSH_PORT" #NODOC
fi fi

View File

@ -8,7 +8,7 @@ source /etc/mailinabox.conf # load global vars
# Some Ubuntu images start off with Apache. Remove it since we # Some Ubuntu images start off with Apache. Remove it since we
# will use nginx. Use autoremove to remove any Apache depenencies. # will use nginx. Use autoremove to remove any Apache depenencies.
if [ -f /usr/sbin/apache2 ]; then if [ -f /usr/sbin/apache2 ]; then
echo Removing apache... echo "Removing apache..."
hide_output apt-get -y purge apache2 apache2-* hide_output apt-get -y purge apache2 apache2-*
hide_output apt-get -y --purge autoremove hide_output apt-get -y --purge autoremove
fi fi

View File

@ -12,12 +12,12 @@ ADMIN=$(./mail.py user admins | head -n 1)
test -z "$1" || ADMIN=$1 test -z "$1" || ADMIN=$1
echo "I am going to unlock admin features for $ADMIN." echo "I am going to unlock admin features for $ADMIN."
echo You can provide another user to unlock as the first argument of this script. echo "You can provide another user to unlock as the first argument of this script."
echo echo
echo WARNING: you could break mail-in-a-box when fiddling around with Nextcloud\'s admin interface echo "WARNING: you could break mail-in-a-box when fiddling around with Nextcloud's admin interface"
echo If in doubt, press CTRL-C to cancel. echo "If in doubt, press CTRL-C to cancel."
echo echo
echo Press enter to continue. echo "Press enter to continue."
read read
sudo -u www-data "php$PHP_VER" /usr/local/lib/owncloud/occ group:adduser admin "$ADMIN" && echo Done. sudo -u www-data "php$PHP_VER" /usr/local/lib/owncloud/occ group:adduser admin "$ADMIN" && echo "Done."