diff options
author | James Moger <james.moger@gitblit.com> | 2011-10-06 07:08:35 -0700 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2011-10-06 07:08:35 -0700 |
commit | a652a6886031ff805fcabd852925c8a11b25dc1c (patch) | |
tree | a2939b0428230280930fba6b6b6bea20a1a80e2b | |
parent | 9e5beeecd2a462337ca5a893bf1458c25df26060 (diff) | |
parent | 134a895dbf6db6b9784f165a3a577d6059949169 (diff) | |
download | gitblit-a652a6886031ff805fcabd852925c8a11b25dc1c.tar.gz gitblit-a652a6886031ff805fcabd852925c8a11b25dc1c.zip |
Merge pull request #1 from mmounirou/master
add a new scripts to install gitblit as a service on linux
-rw-r--r-- | distrib/gitblit | 33 | ||||
-rw-r--r-- | distrib/install-service.sh | 3 |
2 files changed, 36 insertions, 0 deletions
diff --git a/distrib/gitblit b/distrib/gitblit new file mode 100644 index 00000000..9ae4d03c --- /dev/null +++ b/distrib/gitblit @@ -0,0 +1,33 @@ +#!/bin/sh + +set -e + +GITBLIT_PATH=/opt/gitblit/ +GITBLIT_HTTP_PORT=0 +GITBLIT_HTTPS_PORT=8443 +JAVA="java -server -Xmx1024M -jar" + +. /lib/lsb/init-functions + +case "$1" in + start) + log_action_begin_msg "Starting gitblit server" + $JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT & + log_action_end_msg $? + ;; + stop) + log_action_begin_msg "Stopping gitblit server" + $JAVA $GITBLIT_PATH/gitblit.jar --stop & + log_action_end_msg $? + ;; + force-reload|restart) + $0 stop + $0 start + ;; + *) + echo "Usage: /etc/init.d/gitblit {start|stop|restart|force-reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/distrib/install-service.sh b/distrib/install-service.sh new file mode 100644 index 00000000..75d7fcce --- /dev/null +++ b/distrib/install-service.sh @@ -0,0 +1,3 @@ +cp gitblit /etc/init.d/ +chmod +x /etc/init.d/gitblit +sudo update-rc.d gitblit defaults
\ No newline at end of file |