| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# PROVIDE: ergo |
| 4 |
# REQUIRE: DAEMON |
| 5 |
# KEYWORD: shutdown |
| 6 |
|
| 7 |
# |
| 8 |
# Add the following lines to /etc/rc.conf to enable Ergo |
| 9 |
# |
| 10 |
# ergo_enable (bool): Set to YES to enable ergo. |
| 11 |
# Default is "NO". |
| 12 |
# ergo_user (user): Set user to run ergo. |
| 13 |
# Default is "ergo". |
| 14 |
# ergo_group (group): Set group to run ergo. |
| 15 |
# Default is "ergo". |
| 16 |
# ergo_config (file): Set ergo config file path. |
| 17 |
# Default is "/usr/local/etc/ergo/config.yaml". |
| 18 |
# ergo_chdir (dir): Set ergo working directory |
| 19 |
# Default is "/var/db/ergo". |
| 20 |
|
| 21 |
. /etc/rc.subr |
| 22 |
|
| 23 |
name=ergo |
| 24 |
rcvar=ergo_enable |
| 25 |
desc="Ergo IRCv3 server" |
| 26 |
|
| 27 |
load_rc_config "$name" |
| 28 |
|
| 29 |
: ${ergo_enable:=NO} |
| 30 |
: ${ergo_user:=ergo} |
| 31 |
: ${ergo_group:=ergo} |
| 32 |
: ${ergo_chdir:=/var/db/ergo} |
| 33 |
: ${ergo_conf:=/usr/local/etc/ergo/ircd.yaml} |
| 34 |
|
| 35 |
# If you don't define a custom reload function, |
| 36 |
# rc automagically sends SIGHUP to the process on reload. |
| 37 |
# But you have to list reload as an extra_command for that. |
| 38 |
extra_commands="reload" |
| 39 |
|
| 40 |
procname="/usr/local/bin/${name}" |
| 41 |
command=/usr/sbin/daemon |
| 42 |
command_args="-S -T ${name} ${procname} run --conf ${ergo_conf}" |
| 43 |
|
| 44 |
run_rc_command "$1" |
| 45 |
|