Skip to content

Instantly share code, notes, and snippets.

@erfanoabdi
Last active July 8, 2018 11:28
Show Gist options
  • Save erfanoabdi/6452ef698521a64cda2caec74b420488 to your computer and use it in GitHub Desktop.
Save erfanoabdi/6452ef698521a64cda2caec74b420488 to your computer and use it in GitHub Desktop.
#/bin/sh
proptxt="$1"
URL="$2"
dirdis="$3"
while read -r line
do
[[ $line = \#* ]] && continue
[ -z "$line" ] && continue
if [[ $line = '-'* ]]
then
line=`echo "$line" | cut -c2-`
fi
filesrc=`echo "$line" | cut -d ":" -f 1 | cut -d "|" -f 1`
filedis=`echo "$line" | cut -d ":" -f 2 | cut -d "|" -f 1`
filedir=`echo $filedis | rev | cut -d "/" -f 2- | rev`
mkdir -p "$dirdis/$filedir"
wget -q "$URL/$filesrc" -O "$dirdis/$filesrc"
done < "$proptxt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment