Bump x11-drivers/xf86-input-elographics to version 1.4.1_6
[dports.git] / www / py-searx / files / searx.in
1 #!/bin/sh
2 # $FreeBSD: head/www/py-searx/files/searx.in 413931 2016-04-24 09:32:51Z pi $
3
4 # PROVIDE: searx
5 # REQUIRE: DAEMON NETWORKING
6 # BEFORE: LOGIN
7 # KEYWORD: shutdown
8
9 # Add the following lines to /etc/rc.conf to enable searx:
10 # searx_enable="YES"
11 #
12 # searx_enable (bool):  Set to YES to enable searx
13 #                               Default: NO
14 # searx_conf (str):             searx configuration file
15 #                               Default: ${PREFIX}/etc/searx.conf
16 # searx_user (str):             searx daemon user
17 #                               Default: searx
18 # searx_group (str):            searx daemon group
19 #                               Default: searx
20 # searx_flags (str):            Extra flags passed to searx
21
22 . /etc/rc.subr
23
24 name="searx"
25 rcvar=searx_enable
26
27 : ${searx_enable:="NO"}
28 : ${searx_user:="www"}
29 : ${searx_group:="www"}
30 : ${searx_flags:=""}
31
32 # daemon
33 searx_pidfile="/var/run/${name}.pid"
34 python="%%PREFIX%%/bin/python2.7"
35 procname="%%PREFIX%%/lib/python2.7/site-packages/${name}/webapp.py"
36 command=/usr/sbin/daemon
37 command_args=" -c -f -P ${searx_pidfile} ${python} ${procname}"
38 start_precmd="searx_precmd"
39
40 searx_precmd()
41 {
42     install -o ${searx_user} /dev/null ${searx_pidfile}
43 }
44
45 load_rc_config $name
46 run_rc_command "$1"
47