=================================================================== RCS file: /cvs/openbsd/OpenBSDTorrents/runbt.sh,v retrieving revision 1.6 retrieving revision 1.15 diff -u -r1.6 -r1.15 --- openbsd/OpenBSDTorrents/runbt.sh 2005/03/28 23:47:21 1.6 +++ openbsd/OpenBSDTorrents/runbt.sh 2006/05/27 05:31:48 1.15 @@ -1,18 +1,34 @@ #!/bin/sh -#$Id: runbt.sh,v 1.6 2005/03/28 23:47:21 andrew Exp $ +#$RedRiver: runbt.sh,v 1.14 2006/05/15 18:47:04 andrew Exp $ -LOGFILE=runbt.log +. /etc/OpenBSDTorrents.conf +LOGFILE=/home/torrentseeder/runbt.log -echo -n `date` >> ${LOGFILE} -echo Starting . . . >> ${LOGFILE} +cd ${OBT_DIR_HOME} +PIDFILE=${OBT_DIR_HOME}/run/runbt.pid -btlaunchmany.py \ - --super_seeder 1 \ - --minport 10000 --maxport 10500 \ - --saveas /home/ftp/pub/ --saveas_style 2 \ - /home/torrentsync/torrents/ > /dev/null +if [ -e ${PIDFILE} ]; then + PID=`head -1 ${PIDFILE}` + kill -0 ${PID} 2> /dev/null + if [ $? -eq 0 ]; then + echo Already running + exit 1 + fi +fi +echo $$ > ${PIDFILE} + echo -n `date` >> ${LOGFILE} -echo Died . . . >> ${LOGFILE} +echo ' Starting . . . ' >> ${LOGFILE} -/home/OpenBSDTorrents/OpenBSDTorrents/runbt.sh & +nice btlaunchmany \ + --check_hashes 0 \ + --display_interval 600 \ + --minport 60881 --maxport 60981 \ + --max_files_open 25 \ + --saveas_style 2 \ + --save_in ${OBT_DIR_FTP} \ + --torrent_dir ${OBT_DIR_CUR_TORRENT} >> ${LOGFILE} + +echo -n `date` >> ${LOGFILE} +echo ' Died . . . ' >> ${LOGFILE}