1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-07 16:06:14 +00:00

define exit trap after checking for reg (#235)

otherwise script would print an undefined variable for tmpfile

Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
Felix Bartels 2019-09-06 13:10:03 +02:00 committed by GitHub
parent 1d3093680d
commit da43a5abbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,13 +3,6 @@
set -euo pipefail set -euo pipefail
IFS=$'\n\t' IFS=$'\n\t'
function finish {
if [ -e "$tmpfile" ]; then
rm "$tmpfile"
fi
}
trap finish EXIT
if ! command -v reg > /dev/null; then if ! command -v reg > /dev/null; then
echo "Please install reg in order to run this script." echo "Please install reg in order to run this script."
exit 1 exit 1
@ -20,6 +13,13 @@ if [ ! -e ./.env ]; then
exit 1 exit 1
fi fi
function finish {
if [ -e "$tmpfile" ]; then
rm "$tmpfile"
fi
}
trap finish EXIT
# this is a kind of ugly hack to be able to source the env file # this is a kind of ugly hack to be able to source the env file
# this is sadly needed since postfix in https://github.com/tomav/docker-mailserver/ cannot deal with quoted values # this is sadly needed since postfix in https://github.com/tomav/docker-mailserver/ cannot deal with quoted values
tmpfile=$(mktemp /tmp/kopano-docker-env.XXXXXX) tmpfile=$(mktemp /tmp/kopano-docker-env.XXXXXX)