[DRE-commits] [gitlab] 13/23: check if nginx site dir exist

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Fri Jun 3 12:52:41 UTC 2016


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository gitlab.

commit 9d6cc9736bd2fc910eb9a1ba33f449a2f6f6a44a
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Thu Jun 2 21:00:49 2016 +0530

    check if nginx site dir exist
---
 debian/postinst | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/debian/postinst b/debian/postinst
index 6f9c6ff..c08d2d5 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -151,17 +151,20 @@ EOF
       ucf --debconf-ok --three-way ${gitlab_debian_conf_private} ${gitlab_debian_conf}
       ucfr gitlab ${gitlab_debian_conf}
 
-      if test -f ${nginx_conf_example}; then
-        nginx_site="/etc/nginx/sites-available/${GITLAB_HOST}"
-        sed -e "s/YOUR_SERVER_FQDN/${GITLAB_HOST}/"\
-        ${nginx_conf_example} >${nginx_site_private}
-	ucf --debconf-ok --three-way ${nginx_site_private} ${nginx_site}
-	ucfr gitlab ${nginx_site}
-        ln -fs ${nginx_site} /etc/nginx/sites-enabled/
-        rm -f ${nginx_conf_example_tmp}
-      else
-        echo "nginx example configuration file not found"
-        exit 1
+      # configure nginx site
+      if test -d /etc/nginx/sites-available/; then
+        if test -f ${nginx_conf_example}; then
+          nginx_site="/etc/nginx/sites-available/${GITLAB_HOST}"
+          sed -e "s/YOUR_SERVER_FQDN/${GITLAB_HOST}/"\
+          ${nginx_conf_example} >${nginx_site_private}
+          ucf --debconf-ok --three-way ${nginx_site_private} ${nginx_site}
+          ucfr gitlab ${nginx_site}
+          ln -fs ${nginx_site} /etc/nginx/sites-enabled/
+          rm -f ${nginx_conf_example_tmp}
+        else
+          echo "nginx example configuration file not found"
+          exit 1
+        fi
       fi
       # Reload nginx
       if command -v nginx > /dev/null; then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gitlab.git



More information about the Pkg-ruby-extras-commits mailing list