Skip to content

Commit a652a68

Browse files
committed
Merge pull request #1 from mmounirou/master
add a new scripts to install gitblit as a service on linux
2 parents 9e5beee + 134a895 commit a652a68

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

distrib/gitblit

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
GITBLIT_PATH=/opt/gitblit/
6+
GITBLIT_HTTP_PORT=0
7+
GITBLIT_HTTPS_PORT=8443
8+
JAVA="java -server -Xmx1024M -jar"
9+
10+
. /lib/lsb/init-functions
11+
12+
case "$1" in
13+
start)
14+
log_action_begin_msg "Starting gitblit server"
15+
$JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT &
16+
log_action_end_msg $?
17+
;;
18+
stop)
19+
log_action_begin_msg "Stopping gitblit server"
20+
$JAVA $GITBLIT_PATH/gitblit.jar --stop &
21+
log_action_end_msg $?
22+
;;
23+
force-reload|restart)
24+
$0 stop
25+
$0 start
26+
;;
27+
*)
28+
echo "Usage: /etc/init.d/gitblit {start|stop|restart|force-reload}"
29+
exit 1
30+
;;
31+
esac
32+
33+
exit 0

distrib/install-service.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cp gitblit /etc/init.d/
2+
chmod +x /etc/init.d/gitblit
3+
sudo update-rc.d gitblit defaults

0 commit comments

Comments
 (0)