Last active
November 23, 2016 15:13
-
-
Save kokoye2007/99e149c93dc475f8841a to your computer and use it in GitHub Desktop.
This file contains 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 | |
# | |
# ITS FLOSS AND UNDER THE WTFPL. | |
# via Ko Ko Ye <[email protected]> | |
# Ubuntu, Ubuntu-MM, FOSSMM, FOSSASIA, | |
URL=http://dl.fullcirclemagazine.org/issue | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
SP=( | |
"GP01" | |
"LO01" "LO02" "LO03" "LOGOLD01" | |
"IS01" "IS02" | |
"BL01" | |
"UD01" | |
"VM01" | |
"SE01" | |
"SC01" | |
"PY01" "PY02" "PY03" "PY04" "PY05" "PY06" "PY07" "PY08" "PY09") | |
downloadS () { | |
for p in ${SP[*]} | |
do | |
cd "$DIR" | |
mkdir -p Special ; cd $_ | |
echo $p | |
if [ ! -f issue"$p"_en.pdf ]; then | |
axel -a -n 15 "$URL$p"_en.pdf | |
fi | |
done | |
} | |
download () { | |
for n in {114..0} | |
do | |
cd "$DIR" | |
mkdir -p $n && cd $_ | |
# who need epud file. | |
# axel -a -n 15 "$URL$n"_en.epub | |
if [ ! -f issue"$n"_en.pdf ]; then | |
axel -a -n 15 "$URL$n"_en.pdf | |
fi | |
done | |
} | |
case "$1" in | |
i) | |
echo "Download Issue" | |
download | |
exit 1 | |
;; | |
a) | |
echo "Download All - Special + Issue" | |
download | |
downloadS | |
;; | |
s) | |
echo "It's Special Issue" | |
downloadS | |
;; | |
*) | |
clear | |
echo "" | |
echo "Usage: $0 {a|i|s}" | |
echo "Usage: $0 a All" | |
echo "Usage: $0 i Issue" | |
echo "Usage: $0 s Special Edition" | |
echo "" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment