summaryrefslogtreecommitdiffstats
path: root/client/engine/Image.lib
diff options
context:
space:
mode:
Diffstat (limited to 'client/engine/Image.lib')
-rwxr-xr-xclient/engine/Image.lib12
1 files changed, 9 insertions, 3 deletions
diff --git a/client/engine/Image.lib b/client/engine/Image.lib
index 75541dca..728eb24a 100755
--- a/client/engine/Image.lib
+++ b/client/engine/Image.lib
@@ -104,7 +104,7 @@ esac
function ogTiptorrentGet ()
{
-local MAXTRIES
+local MAXTRIES err
i=0
MAXTRIES=3
while [ "$i" -lt $MAXTRIES ]
@@ -118,8 +118,12 @@ if [ $i -eq 3 ]; then
fi
pushd /opt/opengnsys/cache/opt/opengnsys/images > /dev/null || return 1
/opt/opengnsys/bin/tiptorrent-client "$ogrepo" "$1" > /dev/null
+err=$?
popd > /dev/null || return 1
-return $?
+if [ $err -ne 0 ]; then
+ ogRaiseError "$OG_ERR_NOTFOUND" "Error downloading $1 image, tiptorrent-client failed. See /var/log/syslog on the client for details."
+fi
+return $err
}
function ogTiptorrentGetToCache ()
@@ -130,7 +134,9 @@ if ! wget -qO "$1".full.sum "$ogrepo:9999/$2.full.sum"; then
return $?
fi
MD5FILE=$(cat "$1".full.sum)
-ogTiptorrentGet "$2"
+if ! ogTiptorrentGet "$2"; then
+ return 1;
+fi
MD5IMG=$(md5sum "$IMGPATH" | cut -f1 -d " ")
if [ "$MD5IMG" != "$MD5FILE" ]; then
ogRaiseError "$OG_ERR_NOTFOUND" "Error downloading $2, checksum mismatch"