Added
Link Here
|
1 |
#!/bin/sh |
2 |
|
3 |
# PROVIDE: kineto |
4 |
# REQUIRE: NETWORKING SERVERS |
5 |
# BEFORE: DAEMON |
6 |
# KEYWORD: shutdown |
7 |
|
8 |
# |
9 |
# Add some of the following variables to /etc/rc.conf to configure kineto: |
10 |
# kineto_enable (bool): Set to "NO" by default. |
11 |
# Set it to "YES" to enable kineto. |
12 |
# kineto_root (str): Default is gemini://localhost |
13 |
# The gemini root proxy URL |
14 |
# kineto_bind (str): The bind address |
15 |
# unset by default - will bind to :8080 |
16 |
# kineto_css_path (str): File system path of CSS stylesheet |
17 |
# Unset by default |
18 |
# kineto_css_url (str): URL of CSS stylesheet |
19 |
# Unset by default |
20 |
# kineta_user (str): Default "nobody" |
21 |
# The kineto process user |
22 |
# |
23 |
|
24 |
. /etc/rc.subr |
25 |
|
26 |
name="kineto" |
27 |
desc="HTTP to Gemini proxy" |
28 |
rcvar=kineto_enable |
29 |
|
30 |
load_rc_config $name |
31 |
|
32 |
: ${kineto_enable="NO"} |
33 |
: ${kineto_root="gemini://localhost"} |
34 |
: ${kineto_bind=""} |
35 |
: ${kineto_css_peth=""} |
36 |
: ${kineto_css_url=""} |
37 |
: ${kineto_user="nobody"} |
38 |
|
39 |
command="%%PREFIX%%/bin/${name}" |
40 |
command_args="${kineto_root}" |
41 |
pidfile="/var/run/${name}.pid" |
42 |
|
43 |
start_precmd="${name}_setflags" |
44 |
start_cmd="${name}_start" |
45 |
|
46 |
kineto_setflags() { |
47 |
rc_flags="${kineto_bind:+-b $kineto_bind }${kineto_css_path:+-s $kineto_css_path }${kineto_css_url:+-e $kineto_css_url }${rc_flags}" |
48 |
} |
49 |
|
50 |
kineto_start() { |
51 |
check_startmsgs && echo "Starting ${name}." |
52 |
/usr/sbin/daemon -S -s info -l daemon -T $name -u "${kineto_user}" -p "${pidfile}" $command $rc_flags $command_args |
53 |
} |
54 |
|
55 |
run_rc_command "$1" |