diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2022-01-11 15:23:38 +0100 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2022-01-11 15:23:38 +0100 |
commit | 99b29a1a153fbdfb552ddadafc610fb0a741dff3 (patch) | |
tree | 1cc4ee69c4a0da97c4b48efe6fb4374306d6d7cb | |
parent | d4d5c53e61ce15190d70878daf22ac210eda2dcc (diff) |
#1062 tiptorrent stores whole file instead of chunks
Tiptorrent now stores the whole file instead of the split chunks.
Removes any chunk related code from cloning engine scripts.
Requires newer version of tiptorrent installed
(tiptorrent-static >= 1.0.0-6).
-rwxr-xr-x | client/engine/Image.lib | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/client/engine/Image.lib b/client/engine/Image.lib index d45ece45..98d3d19b 100755 --- a/client/engine/Image.lib +++ b/client/engine/Image.lib @@ -131,7 +131,7 @@ if ! wget -qO "$1".full.sum "$ogrepo:9999/$2.full.sum"; then fi MD5FILE=$(cat "$1".full.sum) ogTiptorrentGet "$2" -MD5IMG=$(cat "$IMGPATH"*[0-3] | md5sum | cut -f1 -d " ") +MD5IMG=$(md5sum "$IMGPATH" | cut -f1 -d " ") if [ "$MD5IMG" != "$MD5FILE" ]; then ogRaiseError "$OG_ERR_NOTFOUND" "Error downloading $2, checksum mismatch" return $? @@ -158,7 +158,7 @@ return 0 function ogRestoreImageSyntax () { local TOOL COMPRESSOR LEVEL PART IMGFILE FILEHEAD INFOIMG IMGPATH IMGCACHEDIR -local MD5FILE MD5WGET IMGPATHPART1 +local MD5FILE MD5WGET # Si se solicita, mostrar ayuda. @@ -239,10 +239,9 @@ if [ "$#" -eq 4 ] || [ "$#" -eq 5 ]; then if ogFindCache &>/dev/null; then IMGCACHEDIR=$(ogGetMountPoint $(ogFindCache))/opt/opengnsys/images IMGPATH="$IMGCACHEDIR/$IMGFILE" - IMGPATHPART1="$IMGPATH.1" - if [ -f "$IMGPATHPART1" ]; then + if [ -f "$IMGPATH" ]; then if [ ! -f "$IMGPATH".full.sum ]; then - cat "$IMGPATH"*[0-3] | md5sum | cut -f1 -d " " > "$IMGPATH".full.sum + md5sum "$IMGPATH" | cut -f1 -d " " > "$IMGPATH".full.sum fi MD5FILE=$(cat "$IMGPATH".full.sum) MD5WGET=$(wget -qO - "$ogrepo:9999/$IMGFILE.full.sum") @@ -257,7 +256,7 @@ if [ "$#" -eq 4 ] || [ "$#" -eq 5 ]; then ogRaiseError "$OG_ERR_NOTFOUND" "Failed tiptorrent to cache $TOOL" return $? fi - CAT="cat $IMGPATH*[0-3] |" + CAT="cat $IMGPATH |" COMPRESSOR="$COMPRESSOR -" echo "$CAT $COMPRESSOR $MBUFFER $TOOL" else |