use mktemp for temporary files

This commit is contained in:
Praveen Arimbrathodiyil 2016-02-07 15:51:02 +05:30
parent dd0d0b7db4
commit 2f0f8af4e8

11
debian/postinst vendored
View file

@ -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