From 2f0f8af4e8601e89ee25f80e9300a03f356599f4 Mon Sep 17 00:00:00 2001 From: Praveen Arimbrathodiyil Date: Sun, 7 Feb 2016 15:51:02 +0530 Subject: [PATCH] use mktemp for temporary files --- debian/postinst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/debian/postinst b/debian/postinst index 063ab90f12..7301dfe8f1 100755 --- a/debian/postinst +++ b/debian/postinst @@ -73,8 +73,9 @@ case "$1" in mkdir -p /etc/gitlab/ssl if [ -f "${nginx_ssl_conf_example_gz}" ]; then # undo dh_installdocs auto compress - zcat ${nginx_ssl_conf_example_gz} >/tmp/gitlab-ssl - export nginx_conf_example="/tmp/gitlab-ssl" + export nginx_conf_example_tmp=$(mktemp) + zcat ${nginx_ssl_conf_example_gz} > ${nginx_conf_example_tmp} + export nginx_conf_example=${nginx_conf_example_tmp} fi # Check if letsencrypt option is selected @@ -90,10 +91,10 @@ case "$1" in if test -f ${nginx_conf_example}; then sed -e "s/YOUR_SERVER_FQDN/${GITLAB_HOST}/"\ ${nginx_conf_example} >/etc/nginx/sites-available/${GITLAB_HOST} - ln -fs /etc/nginx/sites-available/${RET} /etc/nginx/sites-enabled/ - rm -f /tmp/gitlab-ssl + ln -fs /etc/nginx/sites-available/${GITLAB_HOST} /etc/nginx/sites-enabled/ + rm -f ${nginx_conf_example_tmp} else - echo "nginx.conf.example not found" + echo "nginx example configuration file not found" exit 1 fi else