Last active
May 30, 2016 18:26
-
-
Save magkopian/b158f0adf6c82e77997057facf74b595 to your computer and use it in GitHub Desktop.
A simple script that allows the recursive download of an entire website.
This file contains hidden or 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 | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 [ULR]" | |
exit 1 | |
fi | |
url=$1 | |
if [[ $url != http?(s)://* ]]; then | |
url="http://$url" | |
fi | |
domain=`echo $url | awk -F/ '{print $3}'` | |
wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains $domain --no-parent $url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment