From cd5825cbb3d04a11d352f0abccea73f834373996 Mon Sep 17 00:00:00 2001
From: Mohamed Mansour <m0.interactive@gmail.com>
Date: Wed, 28 Mar 2012 11:38:57 -0400
Subject: [PATCH] Fixes init script for chkconfig.

---
 distrib/gitblit-centos |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/distrib/gitblit-centos b/distrib/gitblit-centos
index db2fdef..c9fe151 100644
--- a/distrib/gitblit-centos
+++ b/distrib/gitblit-centos
@@ -1,5 +1,6 @@
 #!/bin/bash
 # chkconfig: 3 21 91
+# description: Starts and Stops gitblit
 # Source function library.
 . /etc/init.d/functions
 
@@ -16,6 +17,7 @@
     if [ -f $GITBLIT_PATH/gitblit.jar ];
       then
       echo $"Starting gitblit server"
+      cd $GITBLIT_PATH
       $JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT > /dev/null &
       echo "."
       exit $RETVAL
@@ -25,7 +27,8 @@
   stop)
     if [ -f $GITBLIT_PATH/gitblit.jar ];
       then
-      echo $"Starting gitblit server"
+      echo $"Stopping gitblit server"
+      cd $GITBLIT_PATH
       $JAVA $GITBLIT_PATH/gitblit.jar --stop > /dev/null &
       echo "."
       exit $RETVAL

--
Gitblit v1.9.1