Skip to content

Instantly share code, notes, and snippets.

@luw2007
Last active December 18, 2015 18:59
Show Gist options
  • Select an option

  • Save luw2007/5829268 to your computer and use it in GitHub Desktop.

Select an option

Save luw2007/5829268 to your computer and use it in GitHub Desktop.
利用lftp 多点下载。例子lftpdown https://index.docker.io/v1/repositories/base/images 30 base.img
#!/bin/sh
function _get_down_cmd(){
echo "\"pget -n ${2} '${1}' -o ${3}\""
}
if [[ $# -lt 1 ]]; then
echo "need down_url"
echo "$0 用法: $0 [OPTS] <down_url> [maxconn|number] [base|directory]"
exit 1
fi
echo lftp -c `_get_down_cmd ${1} ${2:-10} ${3:-./}`
_get_down_cmd ${1} ${2:-10} ${3:-./}|xargs lftp -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment