aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/httracker/functions7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/httracker/functions b/lib/httracker/functions
index 7d3b4b5..c1bb689 100644
--- a/lib/httracker/functions
+++ b/lib/httracker/functions
@@ -66,6 +66,13 @@ function httracker_get {
rm -rf $TARGET
fi
+ # Add PDF symlink if needed
+ url_lower="$(echo "$url" | tr '[:upper:]' '[:lower:]')"
+ url_base="$(basename "$url")"
+ if [ "$(basename "$url_lower")" != "$(basename "$url_lower" .pdf)" ]; then
+ ( cd $TARGET && find -iname '*.pdf' -exec ln -s {} $url_base \; )
+ fi
+
# Save as PDF
if [ "$WKHTMLTOPDF" == "1" ] && which xvfb-run &> /dev/null && which wkhtmltopdf &> /dev/null; then
xvfb-run -a wkhtmltopdf "$url" $TARGET/screenshot.pdf