commit | author | age
|
959ad0
|
1 |
#!/bin/bash |
RL |
2 |
# chkconfig: 3 21 91 |
|
3 |
# Source function library. |
|
4 |
. /etc/init.d/functions |
|
5 |
|
|
6 |
# change theses values (default values) |
|
7 |
GITBLIT_PATH=/opt/gitblit |
|
8 |
GITBLIT_HTTP_PORT=0 |
|
9 |
GITBLIT_HTTPS_PORT=8443 |
|
10 |
JAVA="java -server -Xmx1024M -jar" |
|
11 |
|
|
12 |
RETVAL=0 |
|
13 |
|
|
14 |
case "$1" in |
|
15 |
start) |
|
16 |
if [ -f $GITBLIT_PATH/gitblit.jar ]; |
|
17 |
then |
|
18 |
echo $"Starting gitblit server" |
a71c5a
|
19 |
cd $GITBLIT_PATH |
959ad0
|
20 |
$JAVA $GITBLIT_PATH/gitblit.jar --httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT > /dev/null & |
RL |
21 |
echo "." |
|
22 |
exit $RETVAL |
|
23 |
fi |
|
24 |
;; |
|
25 |
|
|
26 |
stop) |
|
27 |
if [ -f $GITBLIT_PATH/gitblit.jar ]; |
|
28 |
then |
797bc6
|
29 |
echo $"Stopping gitblit server" |
a71c5a
|
30 |
cd $GITBLIT_PATH |
959ad0
|
31 |
$JAVA $GITBLIT_PATH/gitblit.jar --stop > /dev/null & |
RL |
32 |
echo "." |
|
33 |
exit $RETVAL |
|
34 |
fi |
|
35 |
;; |
|
36 |
|
|
37 |
force-reload|restart) |
|
38 |
$0 stop |
|
39 |
$0 start |
|
40 |
;; |
|
41 |
|
|
42 |
*) |
|
43 |
echo $"Usage: /etc/init.d/gitblit {start|stop|restart|force-reload}" |
|
44 |
exit 1 |
|
45 |
;; |
|
46 |
esac |
|
47 |
|
|
48 |
exit $RETVAL |