aboutsummaryrefslogtreecommitdiff
path: root/www/kiwix-tools/files/kiwix_serve.in
blob: 7057f1ec14e22d248026ceb5d23f4603913d9a58 (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
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: kiwix_serve
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# kiwix_serve_enable (bool):	Set to NO by default.
#				Set it to YES to enable kiwix_serve.
# kiwix_serve_port (int):	Port on which the daemon will handle HTTP
#				requests. Set to 80 by default.
# kiwix_serve_library (path):	XML file listing ZIM files for the daemon
#				to serve. Use kiwix-manage to create one,
#				and to add ZIM files to it. Set to
#				%%PREFIX%%/share/kiwix/library.xml by default.

. /etc/rc.subr

name=kiwix_serve
rcvar=kiwix_serve_enable

load_rc_config $name

: ${kiwix_serve_enable:=NO}
: ${kiwix_serve_port=80}
: ${kiwix_serve_library="%%PREFIX%%/share/kiwix/library.xml"}

command=%%PREFIX%%/bin/kiwix-serve
command_args="--daemon --port $kiwix_serve_port --library $kiwix_serve_library"

run_rc_command "$1"