Skip to content

Instantly share code, notes, and snippets.

@meysampg
Created September 10, 2023 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meysampg/0c487854775885e42a3ea646c6b37492 to your computer and use it in GitHub Desktop.
Save meysampg/0c487854775885e42a3ea646c6b37492 to your computer and use it in GitHub Desktop.
Download using axel by reading links from a file
#!/bin/bash
if ! command -v axel &> /dev/null; then
echo "axel is not installed. Please install it before running this script."
exit 1
fi
if [ $# -ne 1 ]; then
echo "Usage: $0 <input_file>"
exit 1
fi
input_file="$1"
if [ ! -f "$input_file" ]; then
echo "Input file '$input_file' not found."
exit 1
fi
while IFS= read -r link; do
filename=$(basename "$link")
axel -n 16 -o "$filename" "$link"
done < "$input_file"
echo "Downloads completed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment