diff options
Diffstat (limited to 'testing/atheme-iris/atheme-iris.initd')
-rwxr-xr-x | testing/atheme-iris/atheme-iris.initd | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/testing/atheme-iris/atheme-iris.initd b/testing/atheme-iris/atheme-iris.initd new file mode 100755 index 000000000..e0b371c79 --- /dev/null +++ b/testing/atheme-iris/atheme-iris.initd @@ -0,0 +1,42 @@ +#!/sbin/runscript +# Copyright 2013 Alpine Linux +# Distributed under the terms of the GNU General Public License v2 + +extra_stopped_commands="setup" + +depend() { + use net + need localmount +} + +setup() { + ebegin "Setting up ${SVCNAME}" + cd /var/lib/atheme-iris + python ./clean.py + python ./compile.py + echo "atheme-iris has been compiled succesfully." + echo "Now you can start the daemon with /etc/init.d/atheme-iris start" + eend $? +} + +start() { + ebegin "Starting ${SVCNAME}" + if [ -f /var/lib/atheme-iris/.compiled ]; then + cd ${SVCHOME} + nohup python ./run.py ${ARGS} &>/dev/null & + else + eerror "You must first run /etc/init.d/atheme-iris setup" + fi + setup() + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + if [ -f /var/run/atheme-iris/atheme-iris.pid ]; then + kill $(cat /var/run/atheme-iris/atheme-iris.pid) + else + eerror "atheme-iris is not running." + fi + eend $? +} |