From d7f9b50a369243aa6b1469e570ddf75d73a38321 Mon Sep 17 00:00:00 2001 From: adv Date: Tue, 27 Jan 2015 12:53:50 +0000 Subject: #626 integrar modificaciones en torrent-creator git-svn-id: https://opengnsys.es/svn/branches/version1.0@4490 a21b9725-9963-47de-94b9-378ad31fedc9 --- repoman/bin/torrent-creator | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/repoman/bin/torrent-creator b/repoman/bin/torrent-creator index e890a958..5f951813 100755 --- a/repoman/bin/torrent-creator +++ b/repoman/bin/torrent-creator @@ -32,8 +32,10 @@ for IMG in *.{img,pgz,diff}; do continue fi # Comprobar si ya existe el fichero Torrent para esa imagen. - TORRENT="$IMG.torrent" + TORRENT="$IMG.torrent" SUMFILE="$IMG.sum" + #MD5 completo de todo el fichero imagen + SUMFULLFILE="$IMG.full.sum" if [ -f "$TORRENT" ]; then FILESIZE="$(ls -l $IMG | awk '{print $5}')" read -e TORRFILE TORRSIZE <<<"$(ctorrent -x $TORRENT 2>/dev/null | awk '$1~/<1>/ {print $2,$3}')" @@ -43,10 +45,14 @@ for IMG in *.{img,pgz,diff}; do echo "`date` : Inicio creación de fichero $TORRENT" >> $LOGFILE touch "$LOCKFILE" trap "rm -f $LOCKFILE" 1 2 3 6 9 - rm -f "$TORRENT" "$SUMFILE" + rm -f "$TORRENT" "$SUMFILE" + # datasum de los ultimos megas del fichero para transferencias unicast y multicast DATASUM=$(tail -c1M "$IMG" | md5sum -b | cut -f1 -d" ") echo $DATASUM > "$SUMFILE" - nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATASUM -l 4194304 2>/dev/null + # Datasum completo para transferencias torrent + DATAFULLSUM=$(md5sum -b "$IMG"| cut -f1 -d" ") + echo $DATAFULLSUM > "$SUMFULLFILE" + nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATAFULLSUM -l 4194304 2>/dev/null rm -f "$LOCKFILE" if [ -f "$TORRENT" ]; then echo "`date` : Fin creación de fichero $TORRENT" >> $LOGFILE -- cgit v1.2.3-18-g5258