From 549952c9acc0eb8dab750b8f43f1162f910f0fed Mon Sep 17 00:00:00 2001 From: Tomas Touceda Date: Fri, 3 May 2013 17:05:53 -0300 Subject: Add setup script and init.d script Also, some pep8 fixes --- pkg/leap_mx | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 pkg/leap_mx (limited to 'pkg/leap_mx') diff --git a/pkg/leap_mx b/pkg/leap_mx new file mode 100644 index 0000000..d2c4bc3 --- /dev/null +++ b/pkg/leap_mx @@ -0,0 +1,50 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +pidfile=/var/run/leap_mx.pid \ +rundir=/var/lib/leap_mx/ \ +file=/etc/leap/mx \ +logfile=/var/log/leap_mx.log + +[ -r /etc/default/leap_mx ] && . /etc/default/leap_mx + +test -x /usr/bin/twistd || exit 0 +test -r $file || exit 0 +test -r /etc/leap/ || exit 0 + + +case "$1" in + start) + echo -n "Starting leap_mx: twistd" + start-stop-daemon --start --quiet --exec /usr/bin/twistd -- \ + --pidfile=$pidfile \ + --rundir=$rundir \ + --python=$file \ + --logfile=$logfile + echo "." + ;; + + stop) + echo -n "Stopping leap_mx: twistd" + start-stop-daemon --stop --quiet \ + --pidfile $pidfile + echo "." + ;; + + restart) + $0 stop + $0 start + ;; + + force-reload) + $0 restart + ;; + + *) + echo "Usage: /etc/init.d/leap_mx {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 \ No newline at end of file -- cgit v1.2.3