Skip to content

Instantly share code, notes, and snippets.

@daveWid
Created January 13, 2011 19:37
Show Gist options
  • Save daveWid/778448 to your computer and use it in GitHub Desktop.
Save daveWid/778448 to your computer and use it in GitHub Desktop.
Simple Site Generator
#!/bin/bash
site=""
prefix="output"
# Loop through the variables
while [ "$1" != '' ]
do
case $1 in
-u| --url )
shift
site=$1
;;
-p | --prefix )
shift
prefix=$1
;;
-h | --help )
echo 'Usage: gensite [-u|--url] [-p|--prefix] [-h|--help]'
exit 0
;;
esac
shift
done
# Get the site name
if [ "$site" = '' ]
then
# Get a site
while [ -z "$site" ]
do
echo "Please enter site url:"
read site
done
fi
echo "Generating $site"
`wget $site --recursive --no-host-directories --directory-prefix=$prefix -EkKq`
echo "Finished!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment