Skip to content

Instantly share code, notes, and snippets.

@nimahkh
Created October 9, 2018 14:00
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 nimahkh/976066df928ae84510c4bae5c72eca90 to your computer and use it in GitHub Desktop.
Save nimahkh/976066df928ae84510c4bae5c72eca90 to your computer and use it in GitHub Desktop.
bash script to Download by axel with high speed
#!/bin/bash
if ! which axel > /dev/null; then
while true; do
read -p "Axel not found,Do you wish to install this program?" yn
case $yn in
[Yy]* ) sudo apt-get install axel; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
fi
if which axel > /dev/null;then
url=$1
output=$2
if [ -z "$url" ] || [ -z "$output" ]; then
echo "argument error"
else
axel -s 204800 -n 10 $url >> $2;
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment