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

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

1.1       andrew      1: #!/bin/sh
1.11    ! andrew      2: #$RedRiver: regen.sh,v 1.10 2010/03/08 20:19:37 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.11    ! andrew     44: echo lftp torrents to ${OBT_FTP_SERVER}
        !            45: lftp -c "set ftp:ssl-allow no
        !            46:        open ftp://${OBT_FTP_USER}:${OBT_FTP_PASS}@${OBT_FTP_SERVER}
        !            47:        cd active
        !            48:        mirror -R -r -a -e /home/torrentsync/torrents/.
        !            49:        cd /
        !            50:        mirror -R -r -a /home/torrentsync/torrents/."
1.7       andrew     51:
                     52: sleep 60;
                     53:
1.10      andrew     54: echo
1.7       andrew     55: echo Starting new torrents
                     56: for f in `ls ${OBT_DIR_TORRENT}`; do
                     57:         if [ ! -e ${OBT_DIR_CUR_TORRENT}/$f ]; then
                     58:                 ln -s ${OBT_DIR_TORRENT}/$f ${OBT_DIR_CUR_TORRENT}/$f
                     59:         fi
                     60: done

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