RUBY_HOME is introduced and use to make it easier to change the
path to ruby.

PROG was not set in "centos/git-daemon", and there were some
indentation problems in this file.

Signed-off-by: Christian Couder <[email protected]>
---
 doc/templates/centos/git-daemon |   13 ++++++++-----
 doc/templates/ubuntu/git-daemon |   10 ++++++----
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/doc/templates/centos/git-daemon b/doc/templates/centos/git-daemon
index d977ff7..ac33764 100755
--- a/doc/templates/centos/git-daemon
+++ b/doc/templates/centos/git-daemon
@@ -11,10 +11,13 @@
 # source function library
 . /etc/rc.d/init.d/functions
  
+RUBY_HOME="/opt/ruby-enterprise"
+GITORIOUS_HOME="/var/www/gitorious"
 RETVAL=0
-GIT_DAEMON="/opt/ruby-enterprise/bin/ruby /var/www/gitorious/script/git-daemon 
-d"
+PROG="git-daemon"
+GIT_DAEMON="$RUBY_HOME/bin/ruby $GITORIOUS_HOME/script/git-daemon -d"
 LOCK_FILE=/var/lock/git-daemon
-PID_FILE=/var/www/gitorious/log/git-daemon.pid
+PID_FILE=$GITORIOUS_HOME/log/git-daemon.pid
  
 do_check_pid() {
   if [ -f $PID_FILE ]; then
@@ -32,8 +35,8 @@ start()
 {
   do_check_pid
   if [ $RUNNING != 2 ] ; then
-echo -n $"Starting $PROG: "
-                /bin/su - git -c "$GIT_DAEMON"
+    echo -n $"Starting $PROG: "
+    /bin/su - git -c "$GIT_DAEMON"
     sleep 1
     if [ -f $PID_FILE ] ; then
       success
@@ -93,4 +96,4 @@ case "$1" in
     echo $"Usage: $0 {start|stop|restart|condrestart}"
     RETVAL=1
 esac
-exit $RETVAL
\ No newline at end of file
+exit $RETVAL
diff --git a/doc/templates/ubuntu/git-daemon b/doc/templates/ubuntu/git-daemon
index 431215f..4bdce4a 100755
--- a/doc/templates/ubuntu/git-daemon
+++ b/doc/templates/ubuntu/git-daemon
@@ -10,12 +10,14 @@
 ### END INIT INFO
 
 # Author: Fabio Akita <[email protected]>
- 
+
+RUBY_HOME="/opt/ruby-enterprise"
+GITORIOUS_HOME="/var/www/gitorious"
 RETVAL=0
 PROG="git-daemon"
-GIT_DAEMON="/opt/ruby-enterprise/bin/ruby /var/www/gitorious/script/git-daemon 
-d"
+GIT_DAEMON="$RUBY_HOME/bin/ruby $GITORIOUS_HOME/script/git-daemon -d"
 LOCK_FILE=/var/lock/git-daemon
-PID_FILE=/var/www/gitorious/log/git-daemon.pid
+PID_FILE=$GITORIOUS_HOME/log/git-daemon.pid
  
 do_check_pid() {
   if [ -f $PID_FILE ]; then
@@ -94,7 +96,7 @@ case "$1" in
     fi
     ;;
   *)
-    echo $"Usage: $0 {start|stop|restart|condrestart}"
+    echo "Usage: $0 {start|stop|restart|condrestart}"
     RETVAL=1
 esac
 exit $RETVAL
-- 
1.7.4.1.42.g43f9f 
 
*******************************
This e-mail contains information for the intended recipient only. It may 
contain proprietary material or confidential information. If you are not the 
intended recipient you are not authorised to distribute, copy or use this 
e-mail or any attachment to it. Murex cannot guarantee that it is virus free 
and accepts no responsibility for any loss or damage arising from its use. If 
you have received this e-mail in error please notify immediately the sender and 
delete the original email received, any attachments and all copies from your 
system.

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]

Reply via email to