Skip to content

Instantly share code, notes, and snippets.

@takatoh
Created March 19, 2020 21:58
Show Gist options
  • Save takatoh/59be174a9309703b397f1ede167a5c8d to your computer and use it in GitHub Desktop.
Save takatoh/59be174a9309703b397f1ede167a5c8d to your computer and use it in GitHub Desktop.
#!/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