Replaced the pwd command with Bash's $PWD variable.
This commit is contained in:
parent
2afd0451c1
commit
3399b25084
|
@ -81,7 +81,7 @@ if [ "$TAG" != "$(git describe --always)" ]; then
|
||||||
echo "Updating Mail-in-a-Box to $TAG . . ."
|
echo "Updating Mail-in-a-Box to $TAG . . ."
|
||||||
git fetch --depth 1 --force --prune origin tag "$TAG"
|
git fetch --depth 1 --force --prune origin tag "$TAG"
|
||||||
if ! git checkout -q "$TAG"; then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -142,7 +142,7 @@ cat > /etc/cron.daily/mailinabox-dnssec << EOF;
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Mail-in-a-Box
|
# Mail-in-a-Box
|
||||||
# Re-sign any DNS zones with DNSSEC because the signatures expire periodically.
|
# Re-sign any DNS zones with DNSSEC because the signatures expire periodically.
|
||||||
$(pwd)/tools/dns_update
|
$PWD/tools/dns_update
|
||||||
EOF
|
EOF
|
||||||
chmod +x /etc/cron.daily/mailinabox-dnssec
|
chmod +x /etc/cron.daily/mailinabox-dnssec
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ tr -cd '[:xdigit:]' < /dev/urandom | head -c 32 > /var/lib/mailinabox/api.key
|
||||||
chmod 640 /var/lib/mailinabox/api.key
|
chmod 640 /var/lib/mailinabox/api.key
|
||||||
|
|
||||||
source $venv/bin/activate
|
source $venv/bin/activate
|
||||||
export PYTHONPATH=$(pwd)/management
|
export PYTHONPATH=$PWD/management
|
||||||
exec gunicorn -b localhost:10222 -w 1 --timeout 630 wsgi:app
|
exec gunicorn -b localhost:10222 -w 1 --timeout 630 wsgi:app
|
||||||
EOF
|
EOF
|
||||||
chmod +x $inst_dir/start
|
chmod +x $inst_dir/start
|
||||||
|
@ -116,7 +116,7 @@ minute=$((RANDOM % 60)) # avoid overloading mailinabox.email
|
||||||
cat > /etc/cron.d/mailinabox-nightly << EOF;
|
cat > /etc/cron.d/mailinabox-nightly << EOF;
|
||||||
# Mail-in-a-Box --- Do not edit / will be overwritten on update.
|
# Mail-in-a-Box --- Do not edit / will be overwritten on update.
|
||||||
# Run nightly tasks: backup, status checks.
|
# 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
|
EOF
|
||||||
|
|
||||||
# Start the management server.
|
# Start the management server.
|
||||||
|
|
|
@ -62,7 +62,7 @@ done
|
||||||
mkdir -p /var/lib/munin-node/plugin-state/
|
mkdir -p /var/lib/munin-node/plugin-state/
|
||||||
|
|
||||||
# Create a systemd service for munin.
|
# 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
|
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
|
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
|
hide_output systemctl link -f /lib/systemd/system/munin.service
|
||||||
|
|
|
@ -46,7 +46,7 @@ fi
|
||||||
# in the first dialog prompt, so we should do this before that starts.
|
# in the first dialog prompt, so we should do this before that starts.
|
||||||
cat > /usr/local/bin/mailinabox << EOF;
|
cat > /usr/local/bin/mailinabox << EOF;
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cd $(pwd)
|
cd $PWD
|
||||||
source setup/start.sh
|
source setup/start.sh
|
||||||
EOF
|
EOF
|
||||||
chmod +x /usr/local/bin/mailinabox
|
chmod +x /usr/local/bin/mailinabox
|
||||||
|
|
Loading…
Reference in New Issue