diff --git a/setup/bootstrap.sh b/setup/bootstrap.sh index d804cadf..a9bc2ce8 100644 --- a/setup/bootstrap.sh +++ b/setup/bootstrap.sh @@ -18,11 +18,11 @@ if [ -z "$TAG" ]; then # space, but if we put it in a comment it would confuse the status checks!) # to get the latest version, so the first such line must be the one that we # want to display in status checks. - if [ "`lsb_release -d | sed 's/.*:\s*//' | sed 's/18\.04\.[0-9]/18.04/' `" == "Ubuntu 18.04 LTS" ]; then + if [ "$(lsb_release -d | sed 's/.*:\s*//' | sed 's/18\.04\.[0-9]/18.04/' )" == "Ubuntu 18.04 LTS" ]; then # This machine is running Ubuntu 18.04. TAG=v0.53 - elif [ "`lsb_release -d | sed 's/.*:\s*//' | sed 's/14\.04\.[0-9]/14.04/' `" == "Ubuntu 14.04 LTS" ]; then + elif [ "$(lsb_release -d | sed 's/.*:\s*//' | sed 's/14\.04\.[0-9]/14.04/' )" == "Ubuntu 14.04 LTS" ]; then # This machine is running Ubuntu 14.04. echo "You are installing the last version of Mail-in-a-Box that will" echo "support Ubuntu 14.04. If this is a new installation of Mail-in-a-Box," @@ -68,11 +68,11 @@ fi cd $HOME/mailinabox # Update it. -if [ "$TAG" != `git describe` ]; then +if [ "$TAG" != $(git describe) ]; then echo Updating Mail-in-a-Box to $TAG . . . git fetch --depth 1 --force --prune origin tag $TAG if ! git checkout -q $TAG; then - echo "Update failed. Did you modify something in `pwd`?" + echo "Update failed. Did you modify something in $(pwd)?" exit 1 fi echo diff --git a/setup/dns.sh b/setup/dns.sh index 2a1b6da0..b64a6580 100755 --- a/setup/dns.sh +++ b/setup/dns.sh @@ -132,7 +132,7 @@ cat > /etc/cron.daily/mailinabox-dnssec << EOF; #!/bin/bash # Mail-in-a-Box # Re-sign any DNS zones with DNSSEC because the signatures expire periodically. -`pwd`/tools/dns_update +$(pwd)/tools/dns_update EOF chmod +x /etc/cron.daily/mailinabox-dnssec diff --git a/setup/firstuser.sh b/setup/firstuser.sh index e2d6531c..7caec35d 100644 --- a/setup/firstuser.sh +++ b/setup/firstuser.sh @@ -1,5 +1,5 @@ # If there aren't any mail users yet, create one. -if [ -z "`management/cli.py user`" ]; then +if [ -z "$(management/cli.py user)" ]; then # The outut of "management/cli.py user" is a list of mail users. If there # aren't any yet, it'll be empty. @@ -10,7 +10,7 @@ if [ -z "`management/cli.py user`" ]; then input_box "Mail Account" \ "Let's create your first mail account. \n\nWhat email address do you want?" \ - me@`get_default_hostname` \ + me@$(get_default_hostname) \ EMAIL_ADDR if [ -z "$EMAIL_ADDR" ]; then diff --git a/setup/mail-dovecot.sh b/setup/mail-dovecot.sh index c6e6cb3a..b569c40d 100755 --- a/setup/mail-dovecot.sh +++ b/setup/mail-dovecot.sh @@ -45,8 +45,8 @@ apt_install \ # - https://www.dovecot.org/list/dovecot/2012-August/137569.html # - https://www.dovecot.org/list/dovecot/2011-December/132455.html tools/editconf.py /etc/dovecot/conf.d/10-master.conf \ - default_process_limit=$(echo "`nproc` * 250" | bc) \ - default_vsz_limit=$(echo "`free -tm | tail -1 | awk '{print $2}'` / 3" | bc)M \ + default_process_limit=$(echo "$(nproc) * 250" | bc) \ + default_vsz_limit=$(echo "$(free -tm | tail -1 | awk '{print $2}') / 3" | bc)M \ log_path=/var/log/mail.log # The inotify `max_user_instances` default is 128, which constrains diff --git a/setup/management.sh b/setup/management.sh index dcef0891..1c57bb2e 100755 --- a/setup/management.sh +++ b/setup/management.sh @@ -97,7 +97,7 @@ export LANG=en_US.UTF-8 export LC_TYPE=en_US.UTF-8 source $venv/bin/activate -exec python `pwd`/management/daemon.py +exec python $(pwd)/management/daemon.py EOF chmod +x $inst_dir/start cp --remove-destination conf/mailinabox.service /lib/systemd/system/mailinabox.service # target was previously a symlink so remove it first @@ -112,7 +112,7 @@ minute=$((RANDOM % 60)) # avoid overloading mailinabox.email cat > /etc/cron.d/mailinabox-nightly << EOF; # Mail-in-a-Box --- Do not edit / will be overwritten on update. # Run nightly tasks: backup, status checks. -$minute 3 * * * root (cd `pwd` && management/daily_tasks.sh) +$minute 3 * * * root (cd $(pwd) && management/daily_tasks.sh) EOF # Start the management server. diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index 200eba9e..98645987 100755 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -128,7 +128,7 @@ if [ ! -d /usr/local/lib/owncloud/ ] || [[ ! ${CURRENT_NEXTCLOUD_VER} =~ ^$nextc # Backup the existing ownCloud/Nextcloud. # Create a backup directory to store the current installation and database to - BACKUP_DIRECTORY=$STORAGE_ROOT/owncloud-backup/`date +"%Y-%m-%d-%T"` + BACKUP_DIRECTORY=$STORAGE_ROOT/owncloud-backup/$(date +"%Y-%m-%d-%T") mkdir -p "$BACKUP_DIRECTORY" if [ -d /usr/local/lib/owncloud/ ]; then echo "Upgrading Nextcloud --- backing up existing installation, configuration, and database to directory to $BACKUP_DIRECTORY..." diff --git a/setup/preflight.sh b/setup/preflight.sh index acaf80c9..9d2715c5 100644 --- a/setup/preflight.sh +++ b/setup/preflight.sh @@ -8,7 +8,7 @@ if [[ $EUID -ne 0 ]]; then fi # Check that we are running on Ubuntu 18.04 LTS (or 18.04.xx). -if [ "`lsb_release -d | sed 's/.*:\s*//' | sed 's/18\.04\.[0-9]/18.04/' `" != "Ubuntu 18.04 LTS" ]; then +if [ "$(lsb_release -d | sed 's/.*:\s*//' | sed 's/18\.04\.[0-9]/18.04/' )" != "Ubuntu 18.04 LTS" ]; then echo "Mail-in-a-Box only supports being installed on Ubuntu 18.04, sorry. You are running:" echo lsb_release -d | sed 's/.*:\s*//' diff --git a/setup/start.sh b/setup/start.sh index b4e38e65..0cca66be 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -46,7 +46,7 @@ fi # in the first dialog prompt, so we should do this before that starts. cat > /usr/local/bin/mailinabox << EOF; #!/bin/bash -cd `pwd` +cd $(pwd) source setup/start.sh EOF chmod +x /usr/local/bin/mailinabox diff --git a/setup/webmail.sh b/setup/webmail.sh index 98e12d1a..55fea631 100755 --- a/setup/webmail.sh +++ b/setup/webmail.sh @@ -47,7 +47,7 @@ needs_update=0 #NODOC if [ ! -f /usr/local/lib/roundcubemail/version ]; then # not installed yet #NODOC needs_update=1 #NODOC -elif [[ "$UPDATE_KEY" != `cat /usr/local/lib/roundcubemail/version` ]]; then +elif [[ "$UPDATE_KEY" != $(cat /usr/local/lib/roundcubemail/version) ]]; then # checks if the version is what we want needs_update=1 #NODOC fi diff --git a/setup/zpush.sh b/setup/zpush.sh index 1a84e86a..783f39a4 100755 --- a/setup/zpush.sh +++ b/setup/zpush.sh @@ -27,7 +27,7 @@ TARGETHASH=4b312d64227ef887b24d9cc8f0ae17519586f6e2 needs_update=0 #NODOC if [ ! -f /usr/local/lib/z-push/version ]; then needs_update=1 #NODOC -elif [[ $VERSION != `cat /usr/local/lib/z-push/version` ]]; then +elif [[ $VERSION != $(cat /usr/local/lib/z-push/version) ]]; then # checks if the version needs_update=1 #NODOC fi