summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-irc/psybnc/files/psybnc.initd')
-rw-r--r--net-irc/psybnc/files/psybnc.initd32
1 files changed, 32 insertions, 0 deletions
diff --git a/net-irc/psybnc/files/psybnc.initd b/net-irc/psybnc/files/psybnc.initd
new file mode 100644
index 000000000..add796fa7
--- /dev/null
+++ b/net-irc/psybnc/files/psybnc.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+
+depend() {
+ need net
+}
+
+check_config() {
+ if [ -z "${USER}" ]
+ then
+ eerror "Please set \$USER in /etc/conf.d/psybnc!"
+ return 1
+ fi
+ if [ -z "${BNCPATH}" ]
+ then
+ eerror "Please set \$BNCPATH in /etc/conf.d/psybnc!"
+ return 1
+ fi
+}
+
+start() {
+ ebegin "Starting psybnc"
+ check_config || return 1
+ export HOME="${BNCPATH}"
+ start-stop-daemon -c ${USER} -S -q --chdir ${BNCPATH} -x ${BNCPATH}/psybnc 1>/dev/null 2>&1
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping psybnc"
+ start-stop-daemon -K -q --exec ${BNCPATH}/psybnc -s 9
+ eend $?
+}