diff options
| author | Natanael Copa <ncopa@alpinelinux.org> | 2010-04-06 09:28:30 +0000 |
|---|---|---|
| committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-04-06 09:29:41 +0000 |
| commit | 771e4132de7aef9451791db64086cc04bcaf4814 (patch) | |
| tree | b2b8eef5f93b0d711f280ca3948a445fa9d31cbe /testing/sircbot/sircbot.initd | |
| parent | 16de0c956036ea6df4884b85495b00cce31261e6 (diff) | |
| download | 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.initd | 35 |
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 $? +} + |
