aboutsummaryrefslogtreecommitdiff
path: root/irc/ircd-hybrid/files/ircd-hybrid.in
diff options
context:
space:
mode:
Diffstat (limited to 'irc/ircd-hybrid/files/ircd-hybrid.in')
-rw-r--r--irc/ircd-hybrid/files/ircd-hybrid.in42
1 files changed, 42 insertions, 0 deletions
diff --git a/irc/ircd-hybrid/files/ircd-hybrid.in b/irc/ircd-hybrid/files/ircd-hybrid.in
new file mode 100644
index 000000000000..608af1fef0ae
--- /dev/null
+++ b/irc/ircd-hybrid/files/ircd-hybrid.in
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: ircd-hybrid
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# To get ircd-hybrid enabled at boot, add the following lines to /etc/rc.conf :
+# ircd_hybrid_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable ircd-hybrid.
+
+. /etc/rc.subr
+
+name="ircd_hybrid"
+rcvar=ircd_hybrid_enable
+
+command=/usr/local/bin/ircd
+pidfile=/var/run/ircd/ircd.pid
+required_files=/usr/local/etc/ircd-hybrid/ircd.conf
+
+start_precmd=pid_touch
+stop_postcmd=pid_rm
+
+[ -z "$ircd_hybrid_enable" ] && ircd_hybrid_enable=NO
+[ -z "$ircd_hybrid_user" ] && ircd_hybrid_user=ircd
+
+load_rc_config $name
+
+pid_touch ()
+{
+ touch $pidfile
+ chown $ircd_hybrid_user $pidfile
+}
+
+pid_rm ()
+{
+ rm $pidfile
+}
+
+run_rc_command "$1"