Skip to content

Commit 7b4454c

Browse files
authored
Update juniper-cdn-download
1 parent 28769f9 commit 7b4454c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

juniper-cdn-download

+12-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ echo "Extracted filename: $output_filename"
1515

1616

1717
# Check if the URL contains ".qcow2"
18-
if [[ "$url" == *".qcow2"* ]]; then
18+
if [[ "$url" == *".qcow2?"* ]]; then
1919
output_filename="virtioa.qcow2"
2020
fi
2121

@@ -24,7 +24,16 @@ if [ $# -ge 2 ]; then
2424
output_filename="$2"
2525
fi
2626

27-
28-
2927
# Run aria2c to download the URL
3028
aria2c -x 16 -k 100M -s 16 "$url" --out "$output_filename"
29+
30+
# Check if the output_filename has a .gz extension
31+
if [[ $output_filename == *.gz ]]; then
32+
echo "File is gzip-compressed"
33+
34+
# Decompress the file using gzip
35+
gzip -d "$output_filename"
36+
echo "Decompression complete"
37+
else
38+
echo "File is not gzip-compressed"
39+
fi

0 commit comments

Comments
 (0)