aboutsummaryrefslogtreecommitdiff
path: root/sysutils/gitwatch/files/gitwatch.in
blob: a362fd6467baac6f64d6897d8c94ab6d4a918838 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
#
# $FreeBSD:$
#
# PROVIDE: gitwatch
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# gitwatch_enable (bool):	Set it to "YES" to enable gitwatch
#				Default is "NO".
#
# gitwatch_targets (path):	Set the path to the target directory
#				Default is %%PREFIX%%/etc. Multiple targets can be separated by spaces
#

. /etc/rc.subr

name="gitwatch"
rcvar="gitwatch_enable"

start_cmd="${name}_start"

load_rc_config $name

: ${gitwatch_enable:=NO}
: ${gitwatch_targets:="%%PREFIX%%/etc"}
: ${gitwatch_args:="-l 10"}

command="%%PREFIX%%/bin/${name}"
command_interpreter="%%PREFIX%%/bin/bash"
command_args="${gitwatch_args}"

PATH="${PATH}:%%PREFIX%%/bin"

gitwatch_start() {

    # Start a gitwatch for each target
    for TARGET in ${gitwatch_targets}; do
		${command} ${command_args} "${TARGET}" >/dev/null &
	done
}

run_rc_command "$1"