ports/irc/soju/files/soju.in
Ashish SHUKLA f58c457a77
irc/soju: Update to 0.6.1
- Switch to using upstream Makefile
- Add rc.d script
- Specify a user/group
- Purge patches which don't apply anymore

PR:		271388
2023-05-28 14:59:30 +00:00

32 lines
751 B
Bash

#!/bin/sh
#
# PROVIDE: soju
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# soju_enable (bool): Set to NO by default.
# Set it to YES to enable soju.
# soju_config (path): Set to %%PREFIX%%/etc/soju/config
# by default.
. /etc/rc.subr
name="soju"
rcvar=soju_enable
desc="Soju IRC bouncer"
: ${soju_enable:=NO}
: ${soju_config:=%%PREFIX%%/etc/soju/config}
command=/usr/sbin/daemon
procname="%%PREFIX%%/bin/soju"
pidfile=/var/run/${name}.pid
command_args="-P /var/run/daemon_${name}.pid -p $pidfile -u %%USER%% -H -c -f $procname -config ${soju_config}"
start_precmd="mkdir -p /var/run/soju && chown %%USER%%: /var/run/soju"
load_rc_config $name
run_rc_command "$1"