| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /etc/rc0.d/ |
Upload File : |
#!/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
/bin/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
RETVAL=$?
[ $RETVAL -eq 0 ] && /bin/rm -f /var/lock/subsys/bttrack \
/var/run/bittorrent-tracker.pid
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