From ec497efa69e9cbad466519c21e5cdaa4ea6fd57f Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Thu, 21 Dec 2023 08:44:22 -0800 Subject: [PATCH] Quote echo commands to preserve whitespace. --- setup/bootstrap.sh | 2 +- setup/dkim.sh | 2 +- setup/functions.sh | 2 +- setup/questions.sh | 2 +- setup/start.sh | 12 ++++++------ setup/system.sh | 8 ++++---- setup/web.sh | 4 ++-- tools/owncloud-unlockadmin.sh | 14 +++++++------- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/setup/bootstrap.sh b/setup/bootstrap.sh index 81b0eec7..58c9243e 100644 --- a/setup/bootstrap.sh +++ b/setup/bootstrap.sh @@ -53,7 +53,7 @@ fi # Clone the Mail-in-a-Box repository if it doesn't exist. if [ ! -d "$HOME/mailinabox" ]; then if [ ! -f /usr/bin/git ]; then - echo Installing git . . . + echo "Installing git . . ." apt-get -q -q update DEBIAN_FRONTEND=noninteractive apt-get -q -q install -y git < /dev/null echo diff --git a/setup/dkim.sh b/setup/dkim.sh index 0001d4c4..e4def11f 100755 --- a/setup/dkim.sh +++ b/setup/dkim.sh @@ -10,7 +10,7 @@ source setup/functions.sh # load our functions source /etc/mailinabox.conf # load global vars # Install DKIM... -echo Installing OpenDKIM/OpenDMARC... +echo "Installing OpenDKIM/OpenDMARC..." apt_install opendkim opendkim-tools opendmarc # Make sure configuration directories exist. diff --git a/setup/functions.sh b/setup/functions.sh index 5a153d2a..6a96cc1f 100644 --- a/setup/functions.sh +++ b/setup/functions.sh @@ -25,7 +25,7 @@ function hide_output { if [ $E != 0 ]; then # Something failed. echo - echo FAILED: "$@" + echo "FAILED: $*" echo ----------------------------------------- cat "$OUTPUT" echo ----------------------------------------- diff --git a/setup/questions.sh b/setup/questions.sh index c18ad386..34346595 100644 --- a/setup/questions.sh +++ b/setup/questions.sh @@ -8,7 +8,7 @@ if [ -z "${NONINTERACTIVE:-}" ]; then # # Also install dependencies needed to validate the email address. 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_quiet install dialog python3 python3-pip || exit 1 fi diff --git a/setup/start.sh b/setup/start.sh index 7d1f542e..dbf1c16c 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -122,7 +122,7 @@ source setup/munin.sh # Wait for the management daemon to start... until nc -z -w 4 127.0.0.1 10222 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 done @@ -156,9 +156,9 @@ fi echo echo "-----------------------------------------------" echo -echo Your Mail-in-a-Box is running. +echo "Your Mail-in-a-Box is running." 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 if management/status_checks.py --check-primary-hostname; then # 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 echo "https://$PUBLIC_IP/admin" echo - echo You will be alerted that the website has an invalid certificate. Check that - echo the certificate fingerprint matches: + echo "You will be alerted that the website has an invalid certificate. Check that" + echo "the certificate fingerprint matches:" echo openssl x509 -in "$STORAGE_ROOT/ssl/ssl_certificate.pem" -noout -fingerprint -sha256\ | sed "s/SHA256 Fingerprint=//i" echo - echo Then you can confirm the security exception and continue. + echo "Then you can confirm the security exception and continue." echo fi diff --git a/setup/system.sh b/setup/system.sh index cc543e79..c0959510 100755 --- a/setup/system.sh +++ b/setup/system.sh @@ -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 # PPAs so we can install those packages later. -echo Updating system packages... +echo "Updating system packages..." hide_output apt-get update apt_get_quiet upgrade @@ -136,7 +136,7 @@ apt_get_quiet autoremove # * bc: allows us to do math to compute sane defaults # * openssh-client: provides ssh-keygen -echo Installing system packages... +echo "Installing system packages..." apt_install python3 python3-dev python3-pip python3-setuptools \ netcat-openbsd wget curl git sudo coreutils bc file \ pollinate openssh-client unzip \ @@ -227,7 +227,7 @@ fi # hardware entropy to get going, by drawing from /dev/random. haveged makes this # 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 # 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 [ "$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 fi diff --git a/setup/web.sh b/setup/web.sh index 6969c6ce..acf879a1 100755 --- a/setup/web.sh +++ b/setup/web.sh @@ -8,7 +8,7 @@ source /etc/mailinabox.conf # load global vars # Some Ubuntu images start off with Apache. Remove it since we # will use nginx. Use autoremove to remove any Apache depenencies. 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 autoremove fi @@ -124,7 +124,7 @@ chmod a+r /var/lib/mailinabox/mozilla-autoconfig.xml # Create a generic mta-sts.txt file which is exposed via the # nginx configuration at /.well-known/mta-sts.txt -# more documentation is available on: +# more documentation is available on: # https://www.uriports.com/blog/mta-sts-explained/ # default mode is "enforce". In /etc/mailinabox.conf change # "MTA_STS_MODE=testing" which means "Messages will be delivered diff --git a/tools/owncloud-unlockadmin.sh b/tools/owncloud-unlockadmin.sh index 14a41464..8fcaf593 100755 --- a/tools/owncloud-unlockadmin.sh +++ b/tools/owncloud-unlockadmin.sh @@ -9,15 +9,15 @@ source /etc/mailinabox.conf # load global vars 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 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 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 -echo Press enter to continue. +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 +echo "Press enter to continue." 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."