aboutsummaryrefslogtreecommitdiffstats
path: root/testing/sircbot/sircbot.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-04-06 09:28:30 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-04-06 09:29:41 +0000
commit771e4132de7aef9451791db64086cc04bcaf4814 (patch)
treeb2b8eef5f93b0d711f280ca3948a445fa9d31cbe /testing/sircbot/sircbot.initd
parent16de0c956036ea6df4884b85495b00cce31261e6 (diff)
downloadaports-771e4132de7aef9451791db64086cc04bcaf4814.tar.gz
aports-771e4132de7aef9451791db64086cc04bcaf4814.tar.bz2
aports-771e4132de7aef9451791db64086cc04bcaf4814.tar.xz
testing/sircbot: new aport
Minimalistic IRC bot http://git.alpinelinux.org/cgit/sircbot/
Diffstat (limited to 'testing/sircbot/sircbot.initd')
-rw-r--r--testing/sircbot/sircbot.initd35
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/sircbot/sircbot.initd b/testing/sircbot/sircbot.initd
new file mode 100644
index 0000000000..2e0a9c3302
--- /dev/null
+++ b/testing/sircbot/sircbot.initd
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+
+daemon=/usr/bin/sircbot
+sircbot_user=${sircbot_user:-sircbot}
+sircbot_group=${sircbot_group:-sircbot}
+pidfile=/var/run/sircbot/sircbot.pid
+
+depends() {
+ need net
+ after firewall
+}
+
+checkonfig() {
+ if [ -z "$sircbot_channels" ]; then
+ eerror "Please specify sircbot_channels in /etc/conf.d/sircbot"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting sircbot"
+ start-stop-daemon --start --user $sircbot_user --group $sircbot_group \
+ --umask 0002 --pidfile "$pidfile" \
+ --exec $daemon -- $sircbot_opts $sircbot_channels
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping sircbot"
+ start-stop-daemon --stop --pidfile "$pidfile" --exec $daemon
+ eend $?
+}
+