use mktemp for temporary files
This commit is contained in:
parent
dd0d0b7db4
commit
2f0f8af4e8
1 changed files with 6 additions and 5 deletions
11
debian/postinst
vendored
11
debian/postinst
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue