aboutsummaryrefslogtreecommitdiff
path: root/www/searx/files/searx.in
blob: c70ec82452acfacbf69ed78d101fd055979ff58f (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
44
45
46
47
48
#!/bin/sh
# $FreeBSD$

# PROVIDE: searx
# REQUIRE: DAEMON NETWORKING
# BEFORE: LOGIN
# KEYWORD: shutdown

# Add the following lines to /etc/rc.conf to enable searx:
# searx_enable="YES"
#
# searx_enable (bool):	Set to YES to enable searx
#				Default: NO
# searx_conf (str):		searx configuration file
#				Default: ${PREFIX}/etc/searx.conf
# searx_user (str):		searx daemon user
#				Default: searx
# searx_group (str):		searx daemon group
#				Default: searx
# searx_flags (str):		Extra flags passed to searx

. /etc/rc.subr

name="searx"
rcvar=searx_enable

: ${searx_enable:="NO"}
: ${searx_user:="www"}
: ${searx_group:="www"}
: ${searx_flags:=""}

# daemon
pidfile="/var/run/${name}.pid"
python="%%PYTHON_CMD%%"
script_py="%%PYTHON_SITELIBDIR%%/${name}/webapp.py"
command=/usr/sbin/daemon
procname="daemon"
command_args=" -c -f -P ${pidfile} ${python} ${script_py}"
start_precmd="searx_precmd"

searx_precmd()
{
    install -o ${searx_user} /dev/null ${pidfile}
}

load_rc_config $name
run_rc_command "$1"