summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey C. Ollie <jeff@ocjtech.us>2008-08-12 22:06:10 -0500
committerJeffrey C. Ollie <jeff@ocjtech.us>2008-08-12 22:06:10 -0500
commit5c165b0cf46d9ab90313335fdb5aeb17c5de59a1 (patch)
treec8379f8f35a6dac78a1136f095e3f2d28948f296
parentb2014d814d65e53ed354a9c7b0cad613b720ffed (diff)
downloadnohgooee-5c165b0cf46d9ab90313335fdb5aeb17c5de59a1.tar.gz
nohgooee-5c165b0cf46d9ab90313335fdb5aeb17c5de59a1.tar.xz
nohgooee-5c165b0cf46d9ab90313335fdb5aeb17c5de59a1.zip
Add Source4 from Fedora RPMs
-rwxr-xr-xbttrack.init75
1 files changed, 75 insertions, 0 deletions
diff --git a/bttrack.init b/bttrack.init
new file mode 100755
index 0000000..319c526
--- /dev/null
+++ b/bttrack.init
@@ -0,0 +1,75 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: Start up tracker for BitTorrent
+#
+# processname: bttrack
+# config: /etc/sysconfig/bittorrent
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+# defaults
+TRACKPORT=6969
+TRACKSTATEFILE=/var/lib/bittorrent/state/bttrack
+TRACKOPTS=
+TRACKLOG=/var/log/bittorrent/bttrack.log
+# directory of torrents that the tracker is allowed to serve
+TRACKDIR="/var/lib/bittorrent/data"
+
+# source the config
+. /etc/sysconfig/bittorrent
+
+RETVAL=0
+prog="/usr/bin/bttrack"
+btuser="torrent"
+btgroup="torrent"
+
+case "$1" in
+ start)
+ echo -n $"Starting BitTorrent tracker: "
+ : > /var/run/bittorrent-tracker.pid
+ /bin/chown $btuser:$btgroup /var/run/bittorrent-tracker.pid
+ /sbin/runuser -s /bin/sh -c "$prog --port $TRACKPORT \
+ --dfile $TRACKSTATEFILE --logfile $TRACKLOG $TRACKOPTS \
+ --allowed_dir $TRACKDIR" $btuser &> /dev/null &
+ disown -ar
+ usleep 500000
+ status bttrack &> /dev/null && echo_success || echo_failure
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bttrack
+ echo
+ ;;
+ stop)
+ echo -n $"Shutting down BitTorrent tracker: "
+ killproc $prog
+ #killproc "/usr/bin/python $prog"
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bttrack
+ echo
+ ;;
+ restart|reload)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/bttrack ]; then
+ $0 stop
+ $0 start
+ fi
+ RETVAL=$?
+ ;;
+ status)
+ status bttrack
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+ exit 1
+esac
+
+exit $RETVAL