Created
March 19, 2020 21:58
-
-
Save takatoh/59be174a9309703b397f1ede167a5c8d to your computer and use it in GitHub Desktop.
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/bash | |
export USER=hoge | |
export PASSWORD=fuga | |
export URLBASE=ftp://ftp.example.com | |
function download() { | |
wget --ftp-user $USER --ftp-password $PASSWORD $URLBASE/$1 | |
} | |
export -f download | |
if [[ $1 =~ \.md5$ ]]; then | |
awk '{ print $2 }' $1 | xargs -I % bash -c "download %" | |
md5sum -c $1 | |
else | |
download $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment