Last active
December 18, 2015 18:59
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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