Skip to content

Instantly share code, notes, and snippets.

@filipposmastro
Forked from Mr-Un1k0d3r/cloning.sh
Created November 7, 2017 16:29
Show Gist options
  • Select an option

  • Save filipposmastro/fc161c2540b13062e73318c5cf0f553b to your computer and use it in GitHub Desktop.

Select an option

Save filipposmastro/fc161c2540b13062e73318c5cf0f553b to your computer and use it in GitHub Desktop.
Lazy website cloning
#!/bin/bash
echo "Cloning $1"
wget $1 -O index.html &> /dev/null
TAG="<base href=\"$1\"/></head>"
sed '/<\/head>/i\'"$TAG" index.html | tee index.html &> /dev/null
echo "index.html was saved and modified"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment