aboutsummaryrefslogtreecommitdiffstats
path: root/irc/znc
diff options
context:
space:
mode:
Diffstat (limited to 'irc/znc')
-rw-r--r--irc/znc/Makefile1
-rw-r--r--irc/znc/files/znc.in36
2 files changed, 37 insertions, 0 deletions
diff --git a/irc/znc/Makefile b/irc/znc/Makefile
index eff728ca0366..067251a66052 100644
--- a/irc/znc/Makefile
+++ b/irc/znc/Makefile
@@ -14,6 +14,7 @@ LICENSE= GPLv2
FETCH_ARGS= -Fpr
GNU_CONFIGURE= yes
+USE_RC_SUBR= znc
USES= pkgconfig iconv
USE_GMAKE= yes
WANT_PERL= yes
diff --git a/irc/znc/files/znc.in b/irc/znc/files/znc.in
new file mode 100644
index 000000000000..93b16b316421
--- /dev/null
+++ b/irc/znc/files/znc.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# PROVIDE: znc
+# REQUIRE: LOGIN DAEMON
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf to enable znc:
+#
+# znc_enable: Set to NO by default. Set it to YES to enable it.
+# znc_conf_dir: Directory where znc configuration
+# data is stored.
+# Default: %%PREFIX%%/etc/znc
+# znc_user: The user account znc runs as what
+# you want it to be. It uses 'znc' user by
+# default. Do not sets it as empty or it will run
+# as root.
+#
+
+. /etc/rc.subr
+
+name=znc
+rcvar=${name}_enable
+
+command=%%PREFIX%%/bin/znc
+
+load_rc_config ${name}
+
+: ${znc_enable:="NO"}
+: ${znc_user:="znc"}
+: ${znc_conf_dir="%%PREFIX%%/etc/znc"}
+
+znc_flags=" \
+ ${znc_conf_dir:+-d ${znc_conf_dir}} \
+ ${znc_flags}"
+
+run_rc_command "$1"