security-engineering-ebook/generate.sh

22 lines
433 B
Bash
Raw Normal View History

2021-06-22 06:56:21 +00:00
#!/bin/sh
2020-01-31 21:20:30 +00:00
2020-02-01 14:59:29 +00:00
FINAL_PDF=security-engineering-3rd-edition.pdf
2020-02-01 15:08:35 +00:00
INPUT_FILE="urls.txt"
function assert_installed() {
for var in "$@"; do
if ! which $var &> /dev/null; then
echo "Install $var!"
exit 1
fi
done
}
2021-05-28 20:44:21 +00:00
assert_installed wget pystitcher
2020-02-01 15:08:35 +00:00
2020-02-01 14:59:29 +00:00
echo "Starting PDF download"
wget --timeout=10 --timestamping --input-file "urls.txt"
2020-02-01 14:59:29 +00:00
echo "All PDFs downloaded"
2020-01-31 21:20:30 +00:00
2021-05-28 20:44:21 +00:00
pystitcher book.md "$FINAL_PDF"