diff --git a/setup/bootstrap.sh b/setup/bootstrap.sh index b8b365c4..81b0eec7 100644 --- a/setup/bootstrap.sh +++ b/setup/bootstrap.sh @@ -81,7 +81,7 @@ if [ "$TAG" != "$(git describe --always)" ]; 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 2501795a..a94e890d 100755 --- a/setup/dns.sh +++ b/setup/dns.sh @@ -142,7 +142,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/management.sh b/setup/management.sh index 955f88b9..7fd844ea 100755 --- a/setup/management.sh +++ b/setup/management.sh @@ -100,7 +100,7 @@ tr -cd '[:xdigit:]' < /dev/urandom | head -c 32 > /var/lib/mailinabox/api.key chmod 640 /var/lib/mailinabox/api.key source $venv/bin/activate -export PYTHONPATH=$(pwd)/management +export PYTHONPATH=$PWD/management exec gunicorn -b localhost:10222 -w 1 --timeout 630 wsgi:app EOF chmod +x $inst_dir/start @@ -116,7 +116,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/munin.sh b/setup/munin.sh index 56cdb391..017862de 100755 --- a/setup/munin.sh +++ b/setup/munin.sh @@ -62,7 +62,7 @@ done mkdir -p /var/lib/munin-node/plugin-state/ # Create a systemd service for munin. -ln -sf "$(pwd)/management/munin_start.sh" /usr/local/lib/mailinabox/munin_start.sh +ln -sf "$PWD/management/munin_start.sh" /usr/local/lib/mailinabox/munin_start.sh chmod 0744 /usr/local/lib/mailinabox/munin_start.sh cp --remove-destination conf/munin.service /lib/systemd/system/munin.service # target was previously a symlink so remove first hide_output systemctl link -f /lib/systemd/system/munin.service diff --git a/setup/start.sh b/setup/start.sh index 2a977340..7d1f542e 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