[BACK]Return to regen.sh CVS log [TXT][DIR] Up to [local] / openbsd / OpenBSDTorrents

Annotation of openbsd/OpenBSDTorrents/regen.sh, Revision 1.10

1.1       andrew      1: #!/bin/sh
1.10    ! andrew      2: #$RedRiver: regen.sh,v 1.9 2010/03/03 18:24:47 andrew Exp $
1.1       andrew      3:
1.5       andrew      4: . /etc/OpenBSDTorrents.conf
1.3       andrew      5:
1.5       andrew      6: cd ${OBT_DIR_HOME}
1.6       andrew      7: PIDFILE=${OBT_DIR_HOME}/run/regen.pid
                      8:
                      9: if [ -e ${PIDFILE} ]; then
                     10:         PID=`head -1 ${PIDFILE}`
                     11:         kill -0 ${PID} 2> /dev/null
                     12:         if [ $? -eq 0 ]; then
1.9       andrew     13:                 echo $0 Already running
1.6       andrew     14:                 exit 1
                     15:         fi
                     16: fi
                     17: echo $$ > ${PIDFILE}
1.3       andrew     18:
                     19: if [[ $1 != skip ]]; then
1.10    ! andrew     20:        echo
1.5       andrew     21:        echo ${OBT_DIR_HOME}/MakeTorrents.pl $*
                     22:        ${OBT_DIR_HOME}/MakeTorrents.pl $*
1.3       andrew     23: fi
                     24:
1.10    ! andrew     25: echo
1.5       andrew     26: echo ${OBT_DIR_HOME}/CurrentTorrents.pl
                     27: ${OBT_DIR_HOME}/CurrentTorrents.pl
1.3       andrew     28:
1.7       andrew     29: #if [ $? != 253 ]; then exit; fi
1.3       andrew     30:
1.10    ! andrew     31: echo
1.7       andrew     32: echo Removing old torrents
                     33: for f in `ls ${OBT_DIR_CUR_TORRENT}`; do
                     34:         if [ ! -e ${OBT_DIR_TORRENT}/$f ]; then
                     35:                 rm ${OBT_DIR_CUR_TORRENT}/$f
                     36:         fi
                     37: done
                     38:
1.10    ! andrew     39: echo
1.7       andrew     40: echo ${OBT_DIR_HOME}/ServerTorrents.pl
                     41: ${OBT_DIR_HOME}/ServerTorrents.pl
                     42:
1.10    ! andrew     43: echo
1.7       andrew     44: echo lftp -f ${OBT_DIR_HOME}/lftp.script
                     45: lftp -f ${OBT_DIR_HOME}/lftp.script
                     46:
                     47: sleep 60;
                     48:
1.10    ! andrew     49: echo
1.7       andrew     50: echo Starting new torrents
                     51: for f in `ls ${OBT_DIR_TORRENT}`; do
                     52:         if [ ! -e ${OBT_DIR_CUR_TORRENT}/$f ]; then
                     53:                 ln -s ${OBT_DIR_TORRENT}/$f ${OBT_DIR_CUR_TORRENT}/$f
                     54:         fi
                     55: done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>