aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-02-26 16:46:25 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-02-26 16:46:25 -0300
commit5b9fcb6ddabc2fb4ae001fcb309fb835d057d5e4 (patch)
treeb62831144f780ffab4c8c570b66b2d1a667d208c
parent8b07d8e31128b0b8a0dbb93be93c22e323f3cffc (diff)
downloadscripts-5b9fcb6ddabc2fb4ae001fcb309fb835d057d5e4.tar.gz
scripts-5b9fcb6ddabc2fb4ae001fcb309fb835d057d5e4.tar.bz2
Debian live, jigdo and zsync support at debian-dl
-rwxr-xr-xdebian-dl52
1 files changed, 43 insertions, 9 deletions
diff --git a/debian-dl b/debian-dl
index 78e16c0..9dd94bf 100755
--- a/debian-dl
+++ b/debian-dl
@@ -19,19 +19,53 @@ if [ -z "$1" ]; then
exit 1
fi
+# Determine signature extension
+if echo $FILENAME | grep -qe '^debian-live'; then
+ SIGN="sig"
+else
+ SIGN="sign"
+fi
+
# Fetch hashes
for hash in $HASHES; do
wget -c $BASE/$hash
- wget -c $BASE/$hash.sign
+ wget -c $BASE/$hash.$SIGN
done
-# Set rate limit
-if [ ! -z "$RATE" ]; then
- LIMIT="--limit-rate=$RATE"
-fi
+# Determine transfer method
+if echo $FILENAME | grep -qe '.jigdo$'; then
+ # Check for jigdo
+ if ! which jidgo-lite &> /dev/null; then
+ echo "Please install jigdo-file"
+ exit 1
+ fi
+
+ # Get the image using jigdo
+ jigdo-lite $URL
+elif echo $FILENAME | grep -qe '.zsync$'; then
+ # Check for zsync
+ if ! which zsync &> /dev/null; then
+ echo "Please install zsync"
+ exit 1
+ fi
-# Get the image
-wget -c $LIMIT $URL
+ # Get the image using zsync
+ zsync $URL
+else
+ # Check for wget
+ if ! which wget &> /dev/null; then
+ echo "Please install wget"
+ exit 1
+ fi
+
+ # Set rate limit
+ if [ ! -z "$RATE" ]; then
+ LIMIT="--limit-rate=$RATE"
+ fi
+
+ # Get the image using wget
+ wget -c $LIMIT $URL
+fi
# Check hashes
for hash in $HASHES; do
@@ -42,6 +76,6 @@ done
# Check hash integrity
for hash in $HASHES; do
- echo "Checking $hash.sign..."
- gpg --verify $hash.sign
+ echo "Checking $hash.$SIGN..."
+ gpg --verify $hash.$SIGN
done