File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ sudo cp service-freebsd.sh /usr/local/etc/rc.d/gitblit
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # PROVIDE: gitblit
4+ # BEFORE: LOGIN
5+ # KEYWORD: shutdown
6+
7+ PATH=" /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
8+
9+ . /etc/rc.subr
10+
11+ name=" gitblit"
12+ rcvar=" gitblit_enable"
13+
14+ pidfile=" /var/run/${name} .pid"
15+
16+ start_cmd=" ${name} _start"
17+ stop_cmd=" ${name} _stop"
18+ restart_cmd=" ${name} _restart"
19+
20+
21+ # change theses values (default values)
22+ GITBLIT_PATH=/opt/gitblit
23+ GITBLIT_BASE_FOLDER=/opt/gitblit/data
24+ . ${GITBLIT_PATH} /java-proxy-config.sh
25+ COMMAND_LINE=" java -server -Xmx1024M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -cp gitblit.jar:ext/* com.gitblit.GitBlitServer --baseFolder $GITBLIT_BASE_FOLDER "
26+
27+ gitblit_start ()
28+ {
29+ echo " Starting Gitblit Server..."
30+ cd $GITBLIT_PATH
31+ $COMMAND_LINE --dailyLogFile &
32+ }
33+
34+ gitblit_stop ()
35+ {
36+ echo " Stopping Gitblit Server..."
37+ cd $GITBLIT_PATH
38+ $COMMAND_LINE --stop > /dev/null &
39+ }
40+
41+ gitblit_restart ()
42+ {
43+ $0 stop
44+ sleep 5
45+ $0 start
46+ }
47+
48+ load_rc_config $name
49+ run_rc_command " $1 "
You can’t perform that action at this time.
0 commit comments