diff options
Diffstat (limited to 'repoman/bin/torrent-creator')
-rwxr-xr-x | repoman/bin/torrent-creator | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/repoman/bin/torrent-creator b/repoman/bin/torrent-creator index 21d58581..61765ed5 100755 --- a/repoman/bin/torrent-creator +++ b/repoman/bin/torrent-creator @@ -36,7 +36,7 @@ for IMG in *.{img,pgz}; do SUMFILE="$IMG.sum" if [ -f "$TORRENT" ]; then FILESIZE="$(ls -l $IMG | awk '{print $5}')" - read -e TORRFILE TORRSIZE <<<"$(ctorrent -x $TORRENT | awk '$1~/<1>/ {print $2,$3}')" + read -e TORRFILE TORRSIZE <<<"$(ctorrent -x $TORRENT 2>/dev/null | awk '$1~/<1>/ {print $2,$3}')" [ "$(basename $IMG)" = "$TORRFILE" -a "[$FILESIZE]" = "$TORRSIZE" ] && continue fi # Bloquear imagen, crear ficheros Torrent y Checksum y desbloquear imagen. @@ -44,9 +44,9 @@ for IMG in *.{img,pgz}; do touch "$LOCKFILE" trap "rm -f $LOCKFILE" 1 2 3 6 9 rm -f "$TORRENT" "$SUMFILE" - DATASUM=`md5sum "$IMG" | cut -f1 -d" "` + DATASUM=$(tail -c1M "$IMG" | md5sum -b | cut -f1 -d" ") echo $DATASUM > "$SUMFILE" - nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATASUM + nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATASUM 2>/dev/null rm -f "$LOCKFILE" if [ -f "$TORRENT" ]; then echo "`date` : Fin creación de fichero $TORRENT" >> $LOGFILE |