summaryrefslogtreecommitdiffstats
path: root/repoman
diff options
context:
space:
mode:
authoradv <adv@uma.es>2015-01-27 12:53:50 +0000
committeradv <adv@uma.es>2015-01-27 12:53:50 +0000
commitd7f9b50a369243aa6b1469e570ddf75d73a38321 (patch)
treef86c246676698b320961842c181d49bf64ab1f8e /repoman
parent25b6d2299a049c1d4cc547dcf884f2d88a9028cb (diff)
#626 integrar modificaciones en torrent-creator
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4490 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'repoman')
-rwxr-xr-xrepoman/bin/torrent-creator12
1 files 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